Traverse functions with jquery - find(), eq()
1. When the background
traverses the table, get the value of a column.
2. Examples
traverses the table, get the value of a column.
2. Examples
1) The main framework of html is as follows:
<div class="box-body"> <table id="table1" class="table table-bordered table-striped"> <thead> <tr id="method_title"> <th rowspan="2">Display order</th> <th rowspan="2">名称</th> <th rowspan="2">Order setting</th> <th rowspan="2">操作</th> </tr> </thead> <tbody id="table_body"></tbody> </table> <div id="result"></div> </div>2) The renderings are shown as follows
3) Get the button value of the third row and the fourth column. code show as below:
$("#table1").find("tr").eq(2).find("td").eq(3).text(); //The result is the value of the id label3 button.