jquery text()

来源:互联网 发布:淘宝怎么开手机充值店 编辑:程序博客网 时间:2024/06/05 19:55
<html>
<head>
<script type="text/javascript" src="/jquery/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
  $(".btn1").click(function(){
    $("p").text("Hello world!");
  });
});
</script>
</head>
<body>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
<button class="btn1">改变所有 p 元素的文本内容</button>
</body>
</html>
原创粉丝点击