JQUERY Syntax to use id passed in parameter to refer to a DIV e.g., $("#param2")

I’m passing the id of a div as a parameter. I’m not sure how to refer to it with Jquery. The following does not work:


function updatemail(param1, param2)
  {
       $("#param2").animate({ opacity: "show" }, 300);
  }

I also tried $(param2) but it did not work :frowning:

I need help

It’s not referring to it with jQuery, it’s JavaScript. And in JavaScript you need to concatenate variables with the + sign. So it would be.

$("#" + param2).animate({ opacity: 'show' }, 300);

it worked! Thanks a lot.