在特定行特定列和特定输入中选择属性值

编程入门 行业动态 更新时间:2024-10-27 19:27:55
本文介绍了在特定行特定列和特定输入中选择属性值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

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...

更多推荐

在特定行特定列和特定输入中选择属性值

本文发布于:2023-10-26 08:01:04,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1529569.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:属性   在特定

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!