Posted in Javascript onOctober 12, 2016
实例如下:
$(function() { var i = 1; $('#addText').click(function() { if (i < 9) { $('#main').append('<div><input type="text" name="text" + i + ""/> <a href="#" mce_href="#" class="del-text">del</a></div>'); i++; } else { alert("最多只能添加9个"); } }); //移除input $('.del-text').live('click',function(){ //删除当前对象$(this).parent().remove() $(this).parent().remove(); i--; }) }); //后台获取值Request.Form['控件的名称']
以上就是小编为大家带来的jquery动态添加文本并获取值的方法全部内容了,希望大家多多支持三水点靠木~
jquery动态添加文本并获取值的方法
- Author -
jingxian声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@