Did you check out Part 1 of How to read jQuery for Beginners?
Did you know that jQuery can change CSS on your page on the fly? There is a handy function called “CSS”.
jQuery
This is how to read this piece of code:
Line 1: When the document is ready run some jQuery Code.
Line 2: If a Hyperlink is clicked, get ready and run everything inside this section
Line 3 – All Anchor Tags that are wrapped inside paragraph tags you will switch the font color to red using the jQuery css function.
Heres some xhtml and css that would work with the jQuery:
xhtml
CSS
This is what the initial output would look like:
This is what would happen after you click either “Click me!” ‘s.
In my case I clicked the first one. Notice how both changed?
Leave a Reply