Jquery Selectors


jQuery selectors are used to find or select HTML elements based on their class, id, value, type or attribute.

jQuery offers a powerful set of tools for matching a set of elements in a document.

Jquery selectors are start with the: $().

<p>All Selector (“*”)</p>
<p><li>Selects all elements.</p>

Demo – All Selector

<strong>$("#demo").hide();</strong>
<ul>
	<li>hide() method hidies all the elements with id="demo".</li>
</ul>
<strong>$(".demo").hide();</strong>
<ul>
	<li>hide() method hides all he elements with class="demo".</li>
</ul>
<strong>$(this).hide();</strong>
<ul>
	<li>hide() method hides the current HTML element.</li>
</ul>