Answer the question
In order to leave comments, you need to log in
How values from table to array?
Hi all. there is a table that is formed by php, but in each row there are two cells with a select, which the user "fills" on his own. It is necessary by means of Jquery || js collect all select values in an array. AS?
Answer the question
In order to leave comments, you need to log in
jQ /|\ JS
Go through the tags/classes you need and add values to your (empty?) array.
Do you need it by submit or some other action to do? If yes, then run after submitting or fixing some.
var result = $("table select > option:selected").map(function(){ return $(this).text(); }).get();
console.log(result);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question