jQuery的.load(),输入不工作
问题描述:
我会加载HTML的填充(文件:/retc.html): <input id="x" type="text" name="number" value="" size="5" />
jQuery的.load(),输入不工作
到html另一页上的div: <div id="property"></div>
我会在装入后填入输入值。
我在的onclick函数中使用这个脚本:
$("#property").load("/rect.html"); $('#x').val("5");
输入的加载是确定的,但价值不填充。该值仅在输入时闪烁。哪里有问题?
非常感谢。
答
尝试使用load
函数的回调参数 - 您尝试填充它之前
$("#property").load("/rect.html",function() {
$('#x').val("5");
});
这应该确保文本框可在页面上。
它正在工作非常感谢你:-) – kubaspet