button事件改变标签值

例子一:

<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>

 

转自:

    [1]  http://www.w3school.com.cn/jquery/manipulation_text.asp

 ----- ----- ----- ----- 谢谢大佬打赏----- ----- ----- ----- ----- 

            jQuery(二)button事件改变标签值

 

相关文章:

  • 2022-12-23
  • 2021-12-24
  • 2022-02-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-03
猜你喜欢
  • 2021-12-31
  • 2021-09-07
  • 2021-12-29
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-10
相关资源
相似解决方案