What is jQuery?


jQuery is a JavaScript library, jQuery greatly simplifies JavaScript programming., jQuery is easy to learn.

jQuery Hide and Show

With jQuery, you can hide and show HTML elements with the hide() and show() methods:

Example

$("#hide").click(function(){
    $("p").hide();
});

$("#show").click(function(){
    $("p").show();
});

jQuery Sliding

With jQuery you can create sliding effects on HTML elements:

  • slideDown()
  • slideUp()
  • slideToggle()

Example

$("#flip").click(function(){
    $("#panel").slideDown();
});
 

jQuery Animation

Example

$("button").click(function(){
    $("div").animate({
        left: '250px',
        height: '+=150px',
        width: '+=150px'
    });
}); 

jQuery Manipulating CSS

Example

$("button").click(function(){
    $("h1, h2, p").toggleClass("blue");
});

Comments

Popular Posts