Colman's Profile

My profile | Relational Database & SQL | Javascript, JQuery | Business Analysis

jQuery is a lightweight, "write less, do more", JavaScript library.

About Javascript, JQuery, CSS, HTML5


jQuery is a lightweight, "write less, do more", JavaScript library.

The purpose of jQuery is to make it much easier to use JavaScript on your website.


jQuery Selectors, Events, and Actions

jQuery selectors and Actions are the important parts of the jQuery library.


 JQuery Syntax - Examples


1. The #id Selector

$(document).ready(function(){
  $("button").click(function(){
    $("#test").hide();
  });
});

 

2. The .class Selector

$(document).ready(function(){
  $("button").click(function(){
    $(".test").hide();
  });
});

 

3.  jQuery hide() and show()

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

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

 

4.  jQuery animate()

$("button").click(function(){
  $("div").animate({left: '250px'});
}); 

 

5.  jQuery Get 

$("#btn1").click(function(){
  alert("Text: " + $("#test").text());
});

 

6. jQuery Set

$("#btn1").click(function(){
  $("#test1").text("Invalid password!");
});

 

7.  jQuery append()

$("#btn1").click(function(){
  $("p").append("Some appended text.");
});

 

 

8.  jQuery prepend()

$("#btn1").click(function(){
  $("p").prepend("Some prepended text.");
});

 

 


Screen Shot: Project BOB

JavaScript


JavaScript is a programming language that is one of the core technologies of the World Wide Web, alongside HTML and CSS.


JavaScript Examples (w3schools)

 

 

DEMO 1 (You can try to refresh page in DEMO 1)