所以我想遍历一个内容,假设这个内容有 4 个文本框
<asp:Content runat="server" ID="FeaturedContent" ClientIDMode="Static" ContentPlaceHolderID="MainContent" class="Tester">
Property ID:
<asp:TextBox ID="PersonIDLabel1" runat="server" class="PersonalIDLabel1" onBlur="textBlur(event)" />
<br />
LastName:
<asp:TextBox ID="LastNameTextBox" runat="server" ClientIDMode="Static" onBlur="textBlur(event);" />
<br />
FirstName:
<asp:TextBox ID="FirstNameTextBox" runat="server" ClientIDMode="Static" onBlur="textBlur(event);"/>
<br />
Appraisal Comapny:
<asp:TextBox ID="HireDateTextBox" runat="server" ClientIDMode="Static" onBlur="textBlur(event);"/>
<br />
Appraisal value:
<asp:TextBox ID="EnrollmentTextBox" runat="server" ClientIDMode="Static" onBlur="textBlur(event);"/>
<br />
我想使用 jquery 来获取文本框的所有值,这是我的代码:
$("#FeaturedContent").each(function (index) {
console.log($(this).val());
});
我也试过
$(".Tester").each(function (index) {
console.log($(this).val());
});
$("#MainContent").each(function (index) {
console.log($(this).val());
});
$("#Content").each(function (index) {
console.log($(this).val());
});
$("#TextBox").each(function (index) {
console.log($(this).val());
});
有任何想法吗?我什至可以获得 ASP 标签吗?