Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
135
rated 0 times [  141] [ 6]  / answers: 1 / hits: 32734  / 15 Years ago, wed, july 29, 2009, 12:00:00

How would I do this without jQuery?



$('input[type=submit]').attr('disabled',true);


It doesn't have to be cross-browser compatible; a solution that only works in Firefox is OK.


More From » dom

 Answers
79
var inputs = document.getElementsByTagName(INPUT);
for (var i = 0; i < inputs.length; i++) {
if (inputs[i].type === 'submit') {
inputs[i].disabled = true;
}
}

[#99032] Saturday, July 25, 2009, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jessie

Total Points: 713
Total Questions: 87
Total Answers: 109

Location: Australia
Member since Sat, May 27, 2023
1 Year ago
;