jquery循环获取每个表格的ID

[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]

posted on 2012-01-10 11:52  快乐每一天Joe  阅读(1312)  评论(0编辑  收藏  举报

导航