I often see these 2 selectors, what is the difference? Thanks
This is a ID selector (1)
$("#el")
This is a class selector (2)
$(".el")
So
<div id="el"></div> <-- (1) matches this -->
<div class="el"></div> <-- (2) matches this -->
References
#
matches an element with that ID. .
matches elements with that class.
See more: http://api.jquery.com/category/selectors/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With