w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Loop through multiple TD, grab multiple values, fill array

If your classes will be the same, you could do something like this with jQuery.

It put the values into arrays.

var values =
$("input[class='timestamp_input']").map(function(){return
$(this).val();}).get();

var textAreaValues = $("textarea[class='ts_desc']").map(function(){return
$(this).val();}).get();

console.log(values);

console.log(textAreaValues);

JSFiddle demo here.





© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.