Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejavascript
$("#myID")    // find first matching ID element
$(".myClass") // find first matching class
$("p"); 

Start Doing Stuff

Assuming we have a CSS class called funky that in this example makes the background yellow.

Code Block
languagecss
.funky {
    background-color: yellow;
} 

 

Add Class to Element

Code Block
$("#myID").addClass("funky");

 

References

Good Intro - http://www.catswhocode.com/blog/learning-jquery-the-basics