标签:box name text 获取 cti idt 字符 his 组成
效果:
界面:
<div id="file1"></div> <input value="添加" type="button" onclick="Add(1);" style="margin-top:5px"/>
js代码:
//js叠加文本框 var count = 0; function Add(num) { count += 1; var File1 = document.getElementById("file1"); var div = document.createElement("div"); div.style = "margin-top:3px"; var InputText = document.createElement("input"); InputText.className = "easyui-datebox Uniqueadd"; InputText.type = "text" InputText.id = "ExecuteDate" + count; InputText.style = "width:360px;"; var btn = document.createElement("input"); btn.type = "button"; btn.value = "删除"; btn.onclick = function () { this.parentNode.parentNode.removeChild(this.parentNode); count -= 1; } File1.appendChild(div); div.appendChild(InputText); div.appendChild(btn); //初始化日期控件 $(‘#‘ + InputText.id).datebox({ required: true }); // $(‘#ExecuteDate1‘).next().find(‘input‘).eq(0).val(); // $(‘.Uniqueadd‘).next().find(‘input‘).each(function(){console.log($(this).val());}) } // 获取值组成字符串 var str = ""; $(‘.Uniqueadd‘).next().find(‘.combo-value‘).each(function () { str += $(this).val() + "、"; }); // console.log(str); str = str.substring(0, str.lastIndexOf(‘、‘)); //将最后的、去掉
标签:box name text 获取 cti idt 字符 his 组成
原文地址:http://www.cnblogs.com/lemonmoney/p/7115975.html