Live Webinar: Prompt Engineering: Skill Everyone Must Learn Today
x
C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Find and Display all Text Boxes's Values using JQuery
WhatsApp
Ck Nitin
Jun 17
2015
1.4
k
0
0
<html
xmlns=
"http://www.w3.org/1999/xhtml"
>
<head runat=
"server"
>
<title></title>
<script src=
"Scripts/jquery-1.8.2.js"
></script>
<script>
function GetText() {
$(
'li input:text'
).each(function (i, el) {
console.log($(
this
).closest(
'li'
).find(
'input:text'
).val());
});
}
</script>
</head>
<body>
<form id=
"form1"
runat=
"server"
>
<div id=
"divText"
>
<ul>
<li>
<input type=
"text"
/>
</li>
<li>
<input type=
"text"
/>
</li>
<li>
<input type=
"text"
/>
</li>
<li>
<input type=
"text"
/>
</li>
<li>
<input type=
"text"
/>
</li>
</ul>
<input type=
"button"
value=
"Click Me"
onclick=
"GetText();"
/>
</div>
</form>
</body>
</html>
Asp.Net
JQuery
JAvaScript
Up Next
Find and Display all Text Boxes's Values using JQuery