1
So I wanted to do the following has a form which has several input fields, so I wanted to do the following loop or something similar to get the values of the fields using jquery or js (pure).
I’d like to know a way to do that
1
So I wanted to do the following has a form which has several input fields, so I wanted to do the following loop or something similar to get the values of the fields using jquery or js (pure).
I’d like to know a way to do that
2
Jquery
// pega todos os input
var $inputs = $('form :input');
var values = {};
// percorre os inputs
$inputs.each(function() {
var name = this.name; // nome do input
var value = $(this).val(); // valor do input
});
Thank you worked
Browser other questions tagged javascript node.js
You are not signed in. Login or sign up in order to post.
Tried to do something? What do you know about Javascript?
– Woss