In this example i am going to explain about how to get all filled values using JQuery
Steps To Follow:
1.To get all elements(
textbox,checkbox,radiobutton,textarea) values inside a div with id “parentdiv”
below jQuery code is used.
var outval = "";
$('#parentdiv
input:checked,#parentdiv textarea,#parentdiv input[type=text]').map(function () {
outval += this.value + ",";
}).get().join(',')
alert(outval);
2. If your parentdiv contains many divs inside it then you can use
the below code to get the value.
var outval = "";
jQuery('#parentdiv
> div input:checked,#parentdiv > div textarea,#parentdiv >
input[type=text]').map(function () {
}).get().join(',')
alert(outval);
Do you like this article? Help us to improve. If you have any queries post it in comments.
Other articles you may like
- Check div/element/object is visible or hidden using Jquery - New !!
- Add remove select and set items in select drop down list
- Bind unbind event in jQuery
- Check uncheck all checkboxes in grid view using jquery
- Get current url using JavaScript jQuery
- How to get the keycode for different browser for keyboard characters
- Move items in drop down list from left to right using jQuery
Comments
Post a Comment