This document introduces jQuery, a cross-browser JavaScript library. It discusses jQuery's benefits like cross-browser compatibility and large community plugins. It then demonstrates basic jQuery usage like selecting elements, modifying attributes and events. Finally, it overviews more advanced jQuery features like traversing, manipulating, and animating the DOM.
6. Getting StartDownload jQuery at jquery.com<script type="text/javascript" src="/js/jQuery. js"></script>Microsoft CDN or Google CDN<script src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.js" type="text/javascript"></script><script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js"></script>
7. Hello world jQueryDocument ready$(document).ready(function () { alert("Hello world jQuery");});// Short cut$(function () { alert("Hello world jQuery");});
12. Selector [Hierarchy]$("form input") // descendant<form> <div> Form is surrounded by the green outline</div> <label> Child:</label><input name="name" /> <fieldset> <label> Grandchild:</label><input name="newsletter" /> </fieldset></form>