Skip to main content

jQuery CSS Selectors

By Sam Deering
JavaScript
Share:

Using CSS selectors in jQuery means you can easily change the styles of HTML elements on your web page dynamically!

The beauty of these special selectors is that a simple jQuery CSS selector line can find and change CSS properties for multiple HTML elements all at the same time! Magic.

Here is how you do it:

$("p").css("background-color","yellow");

Try it for yourself!

Source: http://www.w3schools.com/jquery/jquery_selectors.asp

Sam Deering has 15+ years of programming and website development experience. He was a website consultant at Console, ABC News, Flight Centre, Sapient Nitro, and the QLD Government and runs a tech blog with over 1 million views per month. Currently, Sam is the Founder of Crypto News, Australia.

Integromat Tower Ad