//save tablet
jQuery(\"#savetablet\"+jTablets[i].idtablets).on(\'click\', function()
{
alert(\"alertsepy2...\");
console.log(jTablets[i].idtablets);
jQue
To extract number :
var arrNumber = new Array();
$('input[type=number]').each(function(){
arrNumber.push($(this).val());
})
To extract text:
var arrText= new Array();
$('input[type=text]').each(function(){
arrText.push($(this).val());
})
.map
implementationvar arrText= $('input[type=text]').map(function(){
return this.value;
}).get();
$.each($('input[type=number]'),function(){
alert($(this).val());
});
This will alert the value of input type number
fields
Demo is present at http://jsfiddle.net/2dJAN/33/
Assume if all the input elements are inside a form u can refer the below code.
// get all the inputs into an array.
var $inputs = $('#myForm :input');
// not sure if you wanted this, but I thought I'd add it.
// get an associative array of just the values.
var values = {};
$inputs.each(function() {
values[this.name] = $(this).val();
});
You can use:
$(formId).serializeArray();