jQuery Examples

In this page contains jQuery examples. you can try yourself with our interactive snippet editor.

jQuery Examples

j-Query Basic Example

jQuery Syntax Examples

$("p").hide()
The jQuery hide() function, hiding all <p> elements.

$("this").hide()
The jQuery hide() function, hiding current(this) element.

$("#div1").hide()
The jQuery hide() function, hiding whose id="div1" in the elements.

$(".div1").hide()
The jQuery hide() function, hiding whose class=".div1" in the elements.

jQuery Attributes Examples

$("p").attr("style")
The jQuery attr() function, attributes the elements properties.

jQuery Hide/Show Effect Examples

$("p").hide() or $("p").show()
The jQuery hide() or show() function effect to show or hide the content.

jQuery Toggle Effect Examples

$("p").toggle("slow")
The jQuery toggle() function, to perform the toggle effect on selected element.

jQuery Slide Effect Examples

$("#slide").slideDown("slow")
The jQuery slideDown() function, perform the Slide Down on selected element.

$("#slide").slideUp("slow")
The jQuery slideUp() function, perform the Slide Up on selected element.

$("#slide").slideToggle("slow")
The jQuery slideToogle() function, perform both the Slide Up or Down on selected element.

jQuery Fade Effect Examples

$("#slide").fadeIn("slow")
The jQuery fadeIn() function, allow the hide to show of selected element in defined opacity.

$("#slide").fadeOut("slow")
The jQuery fadeOut() function, allow the show to hide of selected element in defined opacity.

$("div").fadeTo("slow",0.20)
The jQuery fadeTo() function, allow the opacity of selected element.

jQuery Animations Effect Examples

$("div").animate({fontSize:"60px"},"slow")
The jQuery animate() function, perform the animation of selected element.

jQuery with HTML Examples

Change Content of HTML elements

Append Content of HTML elements

Prepend Content of HTML elements

Append the Content After HTML elements

Append the Content Before HTML elements

jQuery with CSS Examples

Get CSS Properties values

Set CSS Properties value in selected Elements

Set CSS multiple Properties value in selected Elements

jQuery with AJAX Examples

AJAX function to provide the open the Content file