HTML页面代码 <div> <h1>Click</h1> <button class="add">Click me to add new item</button> <ul class="li"> <li>I am old item.<button class="delete">Delete</button></li> <…
1.当document文档就绪时执行JavaScript代码. 我们为什么使用jQuery库呢?原因之一就在于我们可以使jQuery代码在各种不同的浏览器和存在bug的浏览器上完美运行. <script src="http://code.jquery.com/jquery-1.10.2.min.js"></script> <script> // Different ways to achieve the Document Ready event…