在特定行特定列和特定输入中选择属性值 [英] Select an attribute value in a specific row specific column and specific input

查看:116
本文介绍了在特定行特定列和特定输入中选择属性值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

给出一个包含大量行的表:

Given a table with a plenty of row like this:

<tr>
<td><input class="szoveg" type=text name=p1 maxlength=2 size=2 value="7"></td>
<td><select class="szoveg" name=p2><option value=1 selected>Live<option value=2>Teszt</select></td>
<td><input class="gomb" type=submit value=Modify></td>
<td><input type=hidden name=s_attr value=s_value></td>
<td><input type=hidden name=m_attr value=m_value></td>
<td><input type=hidden name=id value="AAAR7u"></td>
<td><input class="btn" value=Del></td>
</tr>

我想得到:

    p2的 s_attr
  • Éles
  • s_value 选择输入类型

  • id的

  • s_value of the s_attr
  • Éles of the p2 select input type
  • AAR7u of the id

依此类推,我几乎需要< td> 标签内的每个值,我想作为参数提供并调用一个函数...

and so on, I need almost each of the values inside the <td> tags, I want to give as an argument and invoke a function with it...

如何使用jQuery实现?

How can I achieve getting with jQuery?

现在我可以得到只有这个jQuery选择器的行:

Now I can get the row only with this jQuery selector:

$('#table_id tr').eq(1)

但我还需要值....
我们非常感谢您的帮助。

But I need also the values.... Every help is appreciated.

推荐答案

var tr = $('#table_id tr:eq(1)');
tr.find("input[name=s_attr]").val();
tr.find.. etc...

这篇关于在特定行特定列和特定输入中选择属性值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆