Home  >  Article  >  Web Front-end  >  Use jQuery to get the content and the properties of the content_jquery

Use jQuery to get the content and the properties of the content_jquery

WBOY
WBOYOriginal
2016-05-16 16:12:541271browse

复制代码 代码如下:



   
       
       
       
   

   
       
       
       
       

这是要显示粗体的节奏


       

       
        <script><br>             $(document).ready(function(){<br>                 $("#btn1").click(function(){<br>                     alert("Text: " $("#text").text());<br>                 });<br>                 $("#btn2").click(function(){<br>                     alert("HTML: " $("#text").html());<br>                 });<br>                 $("#btn3").click(function(){<br>                     alert("Value: " $("#input").val());<br>                 });<br>             });<br>         </script>
   

Tips:

1、点击事件节点的选择 #botton

2、alert 的代码规则  ("Value: " $("#id").html)

今天的分享就先到这里了,后续我们还将持续更新一些新的jQuery实例。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn