samedi 28 février 2015

Using a jQuery Selector With a Variable


Is there any way to make something like the following code?



var input = ("$(\"#div .input[id='" + id + "']\")");
input.fadeIn();


Or maybe I could use something like the following?



var input = ("\"#div .input[id='" + id + "']\"");
$(input).fadeIn();


PS: Take my apologies as this question was cloned but the answers that I found were too ambiguous.





Aucun commentaire:

Enregistrer un commentaire