<html> <head> <script type="text/javascript" src="/jquery/jquery.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("button").click(function(){ $("p").html("W3School"); }); }); </script> </head> <body> <h2>This is a heading</h2> <p>This is a paragraph.</p> <p>This is another paragraph.</p> <button type="button">请点击这里</button> </body> </html>
相关文章
- html如何修改span的值,如何动态改变div span的内容
- html中div内容居中的方法
- 用js或者jquery动态给div追加内容,不覆盖之前的内容
- Jquery的text()和html()方法在li与div取值结果解析
- 转载 * jQuery实现动态分割div—通过拖动分隔栏实现上下、左右动态改变左右、上下两个相邻div的大小
- 从html字符串中获取div内容---jquery
- 调用jquery的resize方法改变div的宽度和高度在IE中不变,在谷歌中可以正常显示
- html页面设置一个跟随鼠标移动的DIV(jQuery实现)
- 如何从JavaScript中的HTML字符串中提取div中的所有内容
- 如何使用Regexp从Div获取包含其他HTML标记的内容