我有一个像这样的Bootstrap表,
<table class="table table-striped table-bordered">
<tr><th>First Name</th><th>Last Name</th><th>Age</th><th>Delete</th></tr>
<tr><td>Mickey</td><td>Mouse</td><td>5</td><td><button type="submit" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-search"></span></button></td>
<tr><td>Tom</td><td>Cat</td><td>6</td><td><button type="submit" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-search"></span></button></td>
<tr><td>Pooh</td><td>Bear</td><td>4</td><td><button type="submit" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-search"></span></button></td>
<tr><td>Donaled</td><td>Duck</td><td>7</td><td><button type="submit" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-search"></span></button></td>
<tr><td>Jerry</td><td>Mouse</td><td>8</td><td><button type="submit" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-search"></span></button></td>
</table
当用户点击搜索按钮时,我想输出firstname,这是该行的第一个单元格到另一个<div>
。我们如何使用jQuery实现这一目标?
这是我到目前为止所做的事情的链接 - http://jsbin.com/xenapucisi/edit?html,output