我有一个 div 容器,当单击“添加”按钮时,我正在创建一个动态文本框控件
<div id="Container">
<input type="Submit" id="AddTextBox" value="Add">
<!-- Here are my dynamic textboxes -->
<input type="text" value='' class="dynamic">
<input type="text" value='' class="dynamic">
<input type="text" value='' class="dynamic">
</div>
<input type="create" id="create" onclick="GetValue();" value="create">
我想获取所有文本框控件的值,例如:
Function GetValue()
{
var COntain=TextBoxValue+"$"+Textbox2Value+"$"; // so on
}
最佳答案
function GetValue(){
var Contain = "";
$("#Container :text").each(function(){
Contain += $(this).val() + "$";
});
}
关于jquery - 如何获取div所有文本框的值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11271457/