我正在使用jQuery Clone复制元素
克隆的html:
<TABLE id="vehicleSelectTbl" name="vehicleSelectTbl">
<TBODY>
<TABLE id="vehicleCustomTbl" name="vehicleCustomTbl">
<TBODY>
<TR>
<TD width="240">
<STRONG style="FONT-WEIGHT: normal">Equipment $</STRONG>
<INPUT onkeyup="SetDataChangedFlag()" onblur="" id="Veh_2_Equipment" value="0" name="Veh_1_Equipment" onChange="">
</TD>
</TR>
</TBODY>
</TABLE>
</TBODY>
</TABLE>
输入字段
<input onkeyup="SetDataChangedFlag()" onblur="ValidateEquipment(this)" id="Veh_1_Equipment" value="0" name="Veh_1_Equipment">
这是我的JS代码
var $jVehClone1 = jQuery("#vehicleSelectTbl").clone(true);
$jVehClone1.find('#Veh_1_Equipment').attr("onblur", "");
$jVehClone1.find('#Veh_1_Equipment').blur(function () {ValidateEquipment(this)});
$jVehClone1.find('#Veh_1_Equipment').attr("onChange", "");
$jVehClone1.find('#Veh_1_Equipment').change(function () {SetDataChangedFlag()});
$jVehClone1.find('#Veh_1_Equipment').attr('id', 'Veh_'+newNum+'_Equipment').attr('name', 'Veh_'+newNum+'_Equipment');
$jVehClone1.appendTo('#myVehicleTable');
问题: 我能够使用克隆方法复制元素并且工作正常,但是当我搜索
时document.forms[0].elements["Veh_1_Equipment"].value
返回未定义
document.forms[0].elements["Veh_2
_设备&#34;。]值
返回预期的o / p
以上问题仅发生在IE(My Installed IE版本为11)
任何人都有任何想法为什么我的父元素&#34; Veh_1_Equipment&#34;价值未定义?