03jquery学习笔记----------------链式编程-循环注册事件的案例
<script src="jquery-1.8.3.js"></script>
<script type="text/javascript">
$(function () {
//页面加载
$('p').click(function () {
//点击变红
$(this).css('color', 'red');
}).mouseover(function () {
//DOM编程写法
this.style.cursor = 'pointer';
}).mouseleave(function () {
//jquery编程写法
$(this).css('color', '');
});
});
</script>
浙公网安备 33010602011771号