js this获取元素ID

    <table id="cyyj_table" class="table01" cellpadding="5" cellspacing="1">
            <tbody id="tb">
             	<#list li as li>
             		<tr id='${li.id}'>
             			<td width="80%">
             				<input id ='${li.id}' class="customold" style="width:85%"  value='${li.custom}'/>
             			</td>
             			<td align="center">
             				<input class="ordold" style="width:52px" type="number" value='${li.ord}'/>
             			</td>
             			<td align="center">
             				<a class="zxui-linkbutton"  onclick="detCus('${li.id}');">删除</a>
             			</td>
             		</tr>
             	</#list>
            </tbody>
        </table>

js获取table两个input空间的值以及其id。

	$(".customold").each(function(){
		var customold = $(this).val();
		var obj = $(this);
		var customoldid = $(obj).attr('id');
		customolds+=customold+',';
		customoldids+=customoldid+',';
	});

 

posted on 2017-10-22 17:20  ckx0709  阅读(8208)  评论(0编辑  收藏  举报

导航