4 ms·
I think you kind of missed something. The $ by itself in a variable name doesn't do anything. It's simply a notation to keep your DOM elements (and other variab
by buckwilson 17y ago
I think you kind of missed something. The $ by itself in a variable name doesn't do anything. It's simply a notation to keep your DOM elements (and other variables / objects) separated from your jQuery wrapped elements.
$myDiv = $('#myDiv');
Now I know every time that $myDiv is already wrapped in jQ and I won't make the mistake of wrapping it again $($myDiv) in my code.
- axod 17y agoYes, I know. My point is that most people won't know/bother doing $myDiv = $('myDiv'); They'll simply use $('myDiv') all over the place which will be horrible.