Javascript 通过td中的输入更直接地获取标题atribute的替代选项?
我也有桌子Javascript 通过td中的输入更直接地获取标题atribute的替代选项?,javascript,jquery,Javascript,Jquery,我也有桌子 为什么不解释一下这是怎么回事?当我第一次了解eq是关于什么的时候,它相当混乱…解释几乎总是有用的,但是清楚地解释:eq()的作用。thx我知道:eq,但我不习惯使用。另外,propdont work form e我使用的attrprop()应该可以,因为标题既是一个属性也是一个属性,在您自己的示例中,您得到的是属性。 <table id="tabla_descuentos" class="tablesorter dataTable" cellspacing="0">
为什么不解释一下这是怎么回事?当我第一次了解
eq
是关于什么的时候,它相当混乱…解释几乎总是有用的,但是清楚地解释:eq()
的作用。thx我知道:eq
,但我不习惯使用。另外,prop
dont work form e我使用的attr
prop()应该可以,因为标题既是一个属性也是一个属性,在您自己的示例中,您得到的是属性。
<table id="tabla_descuentos" class="tablesorter dataTable" cellspacing="0">
<thead>
<tr role="row">
<th>ID</th>
<th>Activo</th>
<th>Tipo</th>
<th>Monto</th>
<th>Inicio</th>
<th>Termino</th>
</tr>
</thead>
<tbody>
<tr id="tienda_20" class="odd">
<th class="">20</td>
<th class=" sorting_1"><input type="image" title="Activo" src="images/icn_alert_success.png"></td>
<th class="">General</td>
<th class="">- $ 2</td>
<th class="">2014-05-28</td>
<th class="">0000-00-00</td>
</tr>
<tr id="tienda_34" class="even row_selected">
<th class="">34</td>
<th class=" sorting_1"><input type="image" title="No activo" src="images/icn_logout.png"></td>
<th class="">General</td>
<th class="">-100 %</td>
<th class="">0000-00-00</td>
<th class="">0000-00-00</td>
</tr>
<tr id="tienda_38" class="odd">
<th class="">38</td>
<th class=" sorting_1"><input type="image" title="No activo" src="images/icn_logout.png"></td>
<th class="">General</td>
<th class="">-99 %</td>
<th class="">0000-00-00</td>
<th class="">0000-00-00</td>
</tr>
<tr id="tienda_13" class="even">
<th class="">13</td>
<th class=" sorting_1"><input type="image" title="No activo" src="images/icn_logout.png"></td>
<th class="">General</td>
<th class="">- $ 1.000</td>
<th class="">0000-00-00</td>
<th class="">0000-00-00</td>
</tr>
<tr id="tienda_17" class="odd">
<th class="">17</td>
<th class=" sorting_1"><input type="image" title="No activo" src="images/icn_logout.png"></td>
<th class="">Zapato</td>
<th class="">- $ 123</td>
<th class="">0000-00-00</td>
<th class="">0000-00-00</td>
</tr>
</tbody>
</table>
$($($('.row_selected')[0].children[1].firstChild))[0].title
var title = $('tr.row_selected th:eq(1) input').prop('title');