jQuery examples
Do you want to improve your jQuery skills?
jQuery selector
Demonstrates the jQuery hide() function, hiding the current HTML element.
Demonstrates the jQuery hide() function, hiding all
.
Demonstrates the jQuery hide() function, hiding all elements with class="test".
Demonstrates the jQuery hide() function, hiding the element with id="test".
jQuery events
jQuery click()
Demonstrates the jQuery click() event.
jQuery dblclick()
Demonstrates the jQuery dblclick() event.
jQuery mouseenter()
Demonstrates the jQuery mouseenter() event.
jQuery mouseleave()
Demonstrates the jQuery mouseleave() event.
jQuery mousedown()
Demonstrates the jQuery mousedown() event.
jQuery mouseup()
Demonstrates the jQuery mouseup() event.
jQuery hover()
Demonstrates the jQuery hover() event.
jQuery focus() and blur()
Demonstrates the jQuery focus() and blur() events.
jQuery Hide/Show
jQuery hide()
Demonstrates the jQuery hide() method.
jQuery hide() and show()
Demonstrates the jQuery hide() and show() methods.
jQuery toggle()
jQuery toggle() is used to toggle between the hide() and show() methods.
jQuery hide()
Another example of hiding text.
jQuery Fade In/Out
jQuery fadeIn()
Demonstrates the jQuery fadeIn() method.
jQuery fadeOut()
Demonstrates the jQuery fadeOut() method.
jQuery fadeToggle()
Demonstrates the jQuery fadeToggle() method.
jQuery fadeTo()
Demonstrates the jQuery fadeTo() method.
jQuery Sliding
jQuery slideDown()
Demonstrates the jQuery slideDown() method.
jQuery slideUp()
Demonstrates the jQuery slideUp() method.
jQuery slideToggle()
Demonstrates the jQuery slideToggle() method.
jQuery Animation
jQuery animate()
Demonstrates a simple jQuery animate() method.
jQuery animate() - setting multiple CSS properties
Demonstrates changing styles with the jQuery animate() method.
jQuery animate() - using relative values
Demonstrates how to use relative values with the jQuery animate() method.
jQuery animate() - using predefined values
Demonstrates using the predefined "hide", "show", "toggle" values with the animate() method.
jQuery animate()
Demonstrates more jQuery animate() method examples
jQuery animate()
Demonstrates more jQuery animate() method examples (multiple animate() callbacks).
jQuery Stop Animation
jQuery stop() sliding
Demonstrates the jQuery stop() method.
jQuery stop() animation (with parameters)
Demonstrates the jQuery stop() method.
jQuery HTML Get and Attributes
jQuery text() and html() - get text and content
Use the jQuery text() and html() methods to get content.
jQuery val() - get value
Use the jQuery val() method to get a form field's value.
jQuery attr() - get attribute value
Use the jQuery attr() method to get an attribute value.
jQuery HTML set content and attributes
jQuery text(), html(), and val() - set content
Use the jQuery text(), html() and val() methods to set content.
jQuery text() and html() - set content with callback functions
Use text() and html() to set content with callback functions
jQuery attr() - set attribute value
Use the jQuery attr() method to set an attribute value.
jQuery attr() - set multiple attribute values
Use the jQuery attr() method to set multiple attribute values.
jQuery attr() - set attribute value with callback function
Set attribute value + call attr() with a callback function.
jQuery HTML add elements/content
jQuery append()
Add content at the end of the selected element
jQuery prepend()
Add content at the beginning of the selected element
jQuery append() - insert multiple elements
Create new text/HTML elements, jQuery and JavaScript/DOM. Add after the new element text.
jQuery after() and before()
Add HTML elements before and after the selected element.
jQuery after() - insert multiple elements
Create new text/HTML elements, jQuery and JavaScript/DOM. Insert new elements at the end of the selected element.
jQuery HTML remove elements/content
jQuery remove()
Remove the selected element
jQuery empty()
Remove all children of the selected element
jQuery remove() - using a parameter
Filter elements and remove
jQuery Get and Set CSS Classes
jQuery addClass()
Add a class attribute to different elements
jQuery addClass() - multiple classes
Use the addClass() method to add multiple classes
jQuery removeClass()
Remove classes from the specified element
jQuery toggleClass()
Toggle (add/remove) classes on the selected element
jQuery css() method
jQuery css() - return CSS property
Return the CSS property value of the first matched element
jQuery css() - set CSS property
Set the specified CSS property for all matched elements
jQuery css() - set CSS property
Set CSS properties for multiple matched elements
jQuery dimensions
jQuery - return width() and height()
Return the width and height of the specified element
jQuery - return innerWidth() and innerHeight()
Return the inner-width/height of the specified element
jQuery - return outerWidth() and outerHeight()
Return the outer-width/height of the specified element
jQuery - return outerWidth(true) and outerHeight(true)
Return the outer-width/height of the specified element (including margins)
jQuery - return width() and height() of document and window
Return the width and height of the HTML document and window
jQuery - set width() and height()
Set the width and height of the specified element
jQuery Traversing - Ancestors
jQuery parent()
Demonstrates the jQuery parent() method.
jQuery parents()
Demonstrates the jQuery parents() method.
jQuery parentsUntil()
Demonstrates the jQuery parentsUntil() method.
jQuery Traversing - Descendants
jQuery children()
Demonstrate the jQuery children() method.
jQuery find()
Demonstrate the jQuery find() method.
jQuery Traversing - Siblings
jQuery siblings()
Demonstrate the jQuery siblings() method.
jQuery next()
Demonstrate the jQuery next() method.
jQuery nextAll()
Demonstrate the jQuery nextAll() method.
jQuery nextUntil()
Demonstrate the jQuery nextUntil() method.
jQuery AJAX load() Method
jQuery load()
Asynchronously load the content of a file and insert it into
jQuery load()
Asynchronously load the specified element content from a file and insert it into
jQuery load() - Using a Callback Function
Using the callback function of the jQuery load() method.
jQuery AJAX get() and post() Methods
jQuery get()
Use the $.get() method to asynchronously fetch data from the server
jQuery post()
Use the $.post() method to asynchronously fetch data from the server