jQuery Examples
Do you want to test your jQuery selector skills?
Try Our jQuery Selector Tester
jQuery Selectors
$("p").hide() - Hide all <p> elements
$("#test").hide() - Hide the element with id="test"
$(".test").hide() - Hide all elements with class="test"
$(this).hide() - Hide the current HTML element
jQuery Events
jQuery click()
jQuery dblclick()
jQuery mouseenter()
jQuery mouseleave()
jQuery mousedown()
jQuery mouseup()
jQuery hover()
jQuery focus() and blur()
jQuery Hide/Show
jQuery Fade
jQuery Slide
jQuery Animate
jQuery animate()
jQuery animate() - manipulate multiple CSS properties
jQuery animate() - using relative values
jQuery animate() - using pre-defined values
jQuery animate() - several calls after each other
jQuery Stop Animations
jQuery HTML Get Content and Attributes
jQuery text() and html() - Get content
jQuery val() - Get content
jQuery attr() - Get attribute value
Get Content and Attributes explained
jQuery HTML Set Content and Attributes
jQuery text(), html(), and val() - Set content
jQuery text() and html() - Set content with a callback function
jQuery attr() - Set attribute value
jQuery attr() - Set multiple attribute values
jQuery attr() - Set attribute value with a callback function
Set Content and Attributes explained
jQuery HTML Add Elements/Content
jQuery append()
jQuery prepend()
jQuery append() - Insert several new elements
jQuery after() and before()
jQuery after() - Insert several new elements
Add Elements/Content explained
jQuery HTML Remove Elements/Content
Remove Elements/Content explained
jQuery Get and Set CSS Classes
jQuery css() Method
jQuery css() - return CSS property
jQuery css() - set CSS property
jQuery css() - set CSS properties
jQuery Dimensions
jQuery - return width() and height()
jQuery - return innerWidth() and innerHeight()
jQuery - return outerWidth() and outerHeight()
jQuery - return outerWidth(true) and outerHeight(true)
jQuery - return width() and height() of document and window
jQuery - set width() and height()
jQuery Traversing Ancestors
Traversing Ancestors explained
jQuery Traversing Descendants
Traversing Descendants explained
jQuery Traversing Siblings
jQuery Traversing Filtering
Traversing Filtering explained
jQuery Filters
jQuery AJAX load() Method
jQuery AJAX get() and post() Methods
AJAX get() and post() explained