//save tablet
jQuery("#savetablet"+jTablets[i].idtablets).on('click', function()
{
alert("alertsepy2...");
console.log(jTablets[i].idtablets);
jQuery("#tablet"+jTablets[i].idtablets+" .detailsrow").each(function( index ) {
$(this).each(function( index2 ) {
console.log($(this).html());
});
});
});
<div class="column0"><input type="text" value="-D"></div>
<div class="column1"><input type="text" value="D"></div>
<div class="column2"><input type="text" value="D"></div>
<div class="column3"><input type="number" value="0"></div>
<div class="column4"> <input type="number" value="0"></div>
<div class="column5"> <input type="number" value="0"></div>
<div class="column6"><input type="number" value="0"></div>
<div class="column7"><input type="number" value="0"></div>
<div class="column8"><input type="number" value="0"></div>
<div class="column9"> <input type="number" value="0"></div>
<div class="column10"> <input type="number" value=""></div>
<div id="tablet17row0" class="column11">11</div>
<div class="column0"><input type="text" value="-D"></div>
<div class="column1"><input type="text" value="D"></div>
<div class="column2"><input type="text" value="D"></div>
<div class="column3"><input type="number" value="0"></div>
<div class="column4"> <input type="number" value="0"></div>
<div class="column5"> <input type="number" value="0"></div>
<div class="column6"><input type="number" value="0"></div>
<div class="column7"><input type="number" value="0"></div>
<div class="column8"><input type="number" value="0"></div>
<div class="column9"> <input type="number" value="0"></div>
<div class="column10"> <input type="number" value=""></div>
<div id="tablet17row1" class="column11">21</div>
I have the above jQuery .each() that outputs the attached HTML to the console. In this case I want to extract the val() of only the input elements either of type text or type number. Is there some way to isolate just the input elements so I can get their values out into an array?
Thanks in advance...
Assume if all the input elements are inside a form u can refer the below code.
This will alert the value of
input type number
fieldsDemo is present at http://jsfiddle.net/2dJAN/33/
To extract number :
To extract text:
Edit :
.map
implementation