Implementation method of jQuery getting the number of rows of table and outputting the contents of cells

  • 2021-07-01 06:16:31
  • OfStack

This article example shows that jQuery gets the number of rows of table and outputs the cell contents. Share it for your reference, as follows:

js section:

<script language="javascript" type="text/javascript">
$(function() {
  $("#txtInput").attr("value", "90");
  var v_temp = $("#lblMessage").text();
  $("#txtInput01").attr("value", v_temp);
  var flog = $("#div1").hasClass("divtest");
  $("#div1").html("<input type='button' id='id123' style='width:100px; height:150px'>");
  var t01 = $("#table01 tr").length;
  $("#table01").find("td").each(function(i) {
    var t = $(this).text();

HTML section:

<form id="form1" runat="server">
  <input type="text" id="txtInput" runat="server" style=" font:" />
  <asp:Label ID="lblMessage" Text=" I'm testing " runat="server"></asp:Label>
  <input type="text" id="txtInput01" runat="server" />
    <br />
    <asp:TextBox ID="TextBox1" runat="server" Width="156px"></asp:TextBox>
    <input type="button" onclick="createXMLHttpRequest()" />
    <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
   <table id="table01" border="1px"><tr>
  <div id="div1" class="div1">

For more readers interested in jQuery related content, please check the topics of this site: "Summary of jQuery Form (table) Operation Skills", "Summary of jQuery Operation DOM Node Method", "Summary of jQuery Extension Skills", "Summary of jQuery Common Plug-ins and Usage", "Summary of jQuery Drag Effects and Skills", "Summary of Ajax Usage in jquery", "Summary of jQuery Common Classic Special Effects", "Summary of jQuery Animation and Special Effects Usage" and "Summary of jquery Selector Usage"

I hope this article is helpful to everyone's jQuery programming.

Related articles: