jquery循环获取每个表格的ID

来源:互联网 发布:linux下安装eclipse 编辑:程序博客网 时间:2024/06/09 18:21
 

[code="jsp"]<tr>
         <td height="20">
          <input
           type="hidden"
           class="row_id"
           value="${row[10]}"
          />
         </td>
        </tr>[/code]


[code="js"]var value2;
   $(".row_id").each(function() {
      // $(".row_id").length
      value2 += $(this).val() + ",";
     });
   if ($.trim(value2)) {
    value2 = value2.replace("undefined", "");
    value2 = value2.substr(0, value2.length - 1);
   }
   alert(value2);[/code]


[img]http://dl.iteye.com/upload/attachment/0061/9088/a083060c-6d56-37b3-a4ca-631e3ac194c2.jpg[/img]