JQuery Selector
1 (“*â€) All selector
2 : Animated selector
3 [name|=â€valueâ€]
4 [name*=â€valueâ€]
5 $(this)
6 $("p.intro")
7 (“.classâ€)
8 :contains()
9 $("[href]")
10 $("p:first")
11 $()
12 $('#red-id')
It select the specific element in the document that has an ID of red-id.
EX :This will select all elements with tag name and the background color will be red.<!DOCTYPE html> 2. <html> 3. <head> 4. <title>help4code</title> 5. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"> 6. </script> 7. <script type="text/javascript" language="javascript"> 8. $(document).ready(function() { 9. $("p").css("background-color", "red"); 10. }); 11. </script> 12. </head> 13. <body> 14. <p>This is first paragraph.</p> 15. <p>This is second paragraph.</p> 16. <p>This is third paragraph.</p> 17. </body> 18. </html>