I\'ve seen it\'s jquery equivalent:
$(\'input[value=\"something\"]\');
But how do you select it using pure javascript (no jQuery).
Something like this should work...
for(i in document.getElementsByTagName('input')) {
if(i.value == 'desiredValue') {
return i;
}
}
Edit: This will return an array of all matches
var matches = [];
for(i in document.getElementsByTagName('input')) {
if(i.value == 'desiredValue') {
matches.push(i);
}
}