阅读背景:

使用jQuery设置动态创建的文本框的值

来源:互联网 

Using the following code

使用以下代码

var newDiv = $(document.createElement("div"));
var newTextBox;

newTextBox = $(document.createElement("input"))
    .attr("type", "text")
    .attr("id", "textbox")
    .attr("name", "textbox");

newTextBox.val("text");
newDiv.append(newTextBox);
alert(newDiv.html());
var newDiv 



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: