jQuery循环到html表并获取每个td的IDS [英] jquery looping to a html table and get the IDS of each td
问题描述
嗨
我有一个HTML表,其中包含动态行和列,例如以下格式,我需要将以下数据的ID保存在数据库中.
创建动态表时,我给TD分配了ID.
所以我需要在JQuery中为每一行做一个循环,然后我需要获取每个TD的ID,然后我将使用Javascript对象,并将值绑定到该对象,然后将我的对象提供给WCF服务,然后再将其提供给WCF服务. WCF服务将处理其余的事情.
我需要获取复选框ID和标签ID.
所以,请告诉我该怎么做?
Hi
I have a HTML table which contains dynamic rows and columns, like the following format and I need to save the ID''s of the below data in a DB.
While creating the dynamic table I am giving ID''s to TD''s.
So I need to make a loop in JQuery for each row and then I need to get the ID of each TD and I will use Javascript object and I will bind the values to the object and I will give my object to WCF service and after that WCF service will handle the rest of things.
I need to get the check box ID''s and label ID''s.
So please tell me how to do it?
DepartMentRoleName Add Edit Delete View
UAT_SSE checkboxes checkboxes
推荐答案
在JQuery中获取所有TD元素非常非常容易
Getting all the TD elements in JQuery is very, very easy
(" ).each(函数() { ... 用对每个TD做 });
("TD").each(function() { ... do something with each TD });
这篇关于jQuery循环到html表并获取每个td的IDS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!