我无法获得动态文本字段的值。请看下面我的jquery代码。
我在为LandMark创建文本字段时添加了onclick事件。请参见下面的代码。我总是变得不确定。请帮我。
函数dynamicEvent(){
alert("dynamic event");
$(document).ready(function(){
alert("inside ajax --> dynamic");
var table = document.getElementById("dataTable");
alert("table-->"+table);
var rowCount = table.rows.length;
alert("rowCount-->"+rowCount);
alert("value of rowCount"+rowCount);
var uniqueId;
for (var i=rowCount;rowCount>7;i++){
uniqueId = i;
alert("inside for loop");
alert("uniqueId-->"+uniqueId);
var element = document.createElement("input");
uniqueId=uniqueId-1;
element.id = "t02Travelfrom" +uniqueId;
var tfrom=element.id;
alert("tfrom id-->"+tfrom);
var t02Travelfrom=$("tfrom").val();
alert(tfrom+"--value-->" +t02Travelfrom);
}
});
}
$("tfrom")
返回带有标签的元素 tfrom
你需要$(tfrom)
。您不需要双重配额。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句