Thursday, 15 December 2011

jQuery Tutorial

jquery

1. jQuery is a JavaScript Library or simplifies JavaScript programming.
 
2. The jQuery library can be added to a web page with a single line of markup.
The jQuery library contains the following features:
  • HTML element selections
  • HTML element manipulation
  • CSS manipulation
  • HTML event functions
  • JavaScript Effects and animations
  • HTML DOM traversal and modification
  • AJAX
  • Utilities

3. Before you start studying jQuery, you should have a basic knowledge of:
  • HTML
  • CSS
  • JavaScript

4. The jQuery library is stored as a single JavaScript file, containing all the jQuery methods.
It can be added to a web page with the following mark-up:
<head>
<script type="text/javascript" src="jquery.js"></script>
</head> 
5. Please note that the <script> tag should be inside the page's <head> section.

Example-1

You can edit the code, and click on a button to view the result.

syntax:
<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("p").click(function(){
$(this).hide();
});
});
</script>
</head>

<body>
<p>If you click on me, I will disappear.</p>
</body>

</html>

No comments:

Post a Comment