Joined March 2013
·
Posted to
Save DOM elements in variables using jQuery
over 1 year
ago
@stevenwadejr Thank you, you're right and I agree with you, thats a better way to know that you're treating with a jquery object
@stevenwadejr Thank you, you're right and I agree with you, thats a better way to know that you're treating with a jquery object
@becreative-germany yes it's just a variable assignment, but for example if your selector has classes is more efficient to save it on a variable than search it in all the DOM every time you need it, i agree that if the element has an ID, the jQuery funcion use getElementById native JS function, so this should have no problems, but for classes is more efficient save it on a variable.
@itg you're right, thank you for the observation!