jQuery(二)button事件改變標簽值


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

 ----- ----- ----- ----- 謝謝大佬打賞----- ----- ----- ----- ----- 

           

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM