You can use
document.getElementsByName
to get all elements with a specific
name
. This returns an array, over which you can iterate:
var elems = document.getElementsByName("v[]");
for (var i = 0; i < elems.length; i++) {
elems[i].setAttribute('value', 'text');
}
Quote:
also how can getElemntByValue?
This method does not exist. You'll have to write your own.
See
http://stackoverflow.com/a/16527048[
^]