Hello. There is such a question. I have a table, and there are many INPUT in it. Is it possible to somehow JavaScript gather all these values ​​into an array?

    1 answer 1

    Like that:

     var mass = new Array(); $("table input").each(function(){ mass.push($(this).val()); }); 
    • Thanks It works. You can still mass[i]=$(this).val(); i++; mass[i]=$(this).val(); i++; - alex_90
    • 2
      In general, in this case it is better to use map: var mass = $ ("table input"). Map (function () {return $ (this) .val ();}); - aachurin