Here's a list of selectors I've seen before:
$('.menu')
$('menu')
$('#menu')
Could anyone clarify in what scenario(s) each would be used?
$('.menu')
... select elements with class='menu'
$('menu')
..... select <menu />
elements
$('#menu')
... select an element with id='menu'
1st finds <div class="menu"></div>
2nd finds <menu></menu>
3rd finds <div id="menu"></div>
Note that these rules applies and are based on CSS.
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