Jquery官网(www.jquery.com)是这么介绍Jquery的
jQuery is a fast, small, and feature-rich JavaScript library. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers. With a combination of versatility and extensibility, jQuery has changed the way that millions of people write JavaScript.
翻译:
jQuery是一个快速,体积小,功能丰富的JavaScript库。
这使得HTML文档遍历操作,事件处理,动画和Ajax这样的事情更简单,易于使用的API,可跨多种浏览器。随着通用性和可扩展性的组合中,jQuery已经改变了千百万人编写JavaScript。
jquery的最大特点就是是个轻量级的js框架(面试的时候被问到过)
<!--引入jquery 可在Jquery官网下载 -->
<script src="jquery-1.10.2.js" type="text/javascript"></script>
<script type="text/javascript">
$(function(){//比onload 提前
alert('learn1');
$('#btn').click(function(){
alert($('#chn').val())
})
$('div').click(function(){
$(this).hide();
});
});
</script>
<body>
<input type="text" id="chn" />
<input type="button" id="btn" />
<div>
sorry!!!!!!
</div>
</body>