码迷,mamicode.com
首页 > Web开发 > 详细

js this获取元素ID

时间:2017-10-22 21:39:56      阅读:273      评论:0      收藏:0      [点我收藏+]

标签:func   idt   logs   lis   获取   button   lsp   highlight   value   

    <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+‘,‘;
	});

 

js this获取元素ID

标签:func   idt   logs   lis   获取   button   lsp   highlight   value   

原文地址:http://www.cnblogs.com/ckxlovejava/p/7710792.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!