jquery Gets the number of table rows and outputs the contents of the cell implementation method _jquery

Source: Internet
Author: User

The example in this article tells jquery to get the table row number and output the cell contents. Share to everyone for your reference, specific as follows:

JS section:

<script language= "javascript" type= "Text/javascript" >
$ (function () {
  $ ("#txtInput"). attr ("Value", " );
  var v_temp = $ ("#lblMessage"). Text ();
  alert (v_temp);
  $ ("#txtInput01"). attr ("value", v_temp);
  $ ("#div1"). Removeclass ("Div1");
  $ ("#div1"). AddClass ("Divtest");
  var flog = $ ("#div1"). Hasclass ("Divtest");
  $ ("#div1"). HTML ("<input type= ' button ' id= ' id123 ' style= ' width:100px; height:150px ' > ');
  var t01 = $ ("#table01 tr"). Length;
  alert (t01);
  $ ("#table01"). Find ("TD"). each (the function (i) {
    var t = $ (this). text ();
    Alert (t);
  })
};
</script>

HTML section:

<form id= "Form1" runat= "Server" > <div> <input type= "text" id= "Txtinput" runat= "server" style= "font:" /> <br/> <asp:label id= "lblmessage" text= "I'm Testing" runat= "server" ></asp:Label> <br/> <i Nput type= "text" id= "txtInput01" runat= "server"/> <br/> <asp:textbox id= "TextBox1" runat= "Server" Wi  Dth= "156px" ></asp:TextBox> <input type= "button" onclick= "Createxmlhttprequest ()"/> 
  Id= "TextBox2" runat= "Server" ></asp:TextBox> </div> <table id= "table01" border= "1px" ><tr> <td>11</td><td>11</td></tr> <tr><td>22</td><td>22</td ></tr> <tr><td>33</td><td>33</td></tr> <tr><td>44</ Td><td>44</td></tr> <tr><td>55</td><td>55</td></tr> </table> <div id= "Div1" class= "Div1" >
  </div> </form>

 

More interested readers of jquery-related content can view the site topics: "JQuery table (table) Operation Tips Summary", "JQuery Operation Dom Node method summary", "JQuery Extended Skills Summary", "jquery common Plug-ins and Usage summary", " jquery drag-and-drop effects and tips summary, "jquery Ajax Usage Summary", "jquery common Classic Effects Summary", "jquery animation and special effects usage Summary" and "jquery Selector usage Summary"

I hope this article will help you with the jquery program design.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.