1 Use of the jquery
Method One:
Place the second text input box to disabled by setting the value of disabled
Text2.attr ("Disabled", "disabled");
}else{
Removes the Disable property of the second text input box by removing it
Text2.removeattr ("Disabled");
}
Method Two:
$ ("Button:eq (0)"). Click (function () {
var text1=$ ("Input:text:eq (0)");
if (text1.attr ("disabled") = = "") {
or text1.attr ("disabled") ==false
Set the value of disabled to place the first text input box as disabled
Text1.attr ("Disabled", "disabled");
}else{
Clears the disabled property in the first text input box by overriding the
Text1.attr ("Disabled", "" ");
}
});
Method Three:
$ ("Button:eq (2)"). Click (function () {
var text2=$ ("Input:text:eq (2)");
if (text2.attr ("disabled") ==false) {
The third text input box disabled property is set to True by setting the Boolean property of disabled
Text2.attr ("Disabled", true);
}else{
Remove the disabled property by placing the third text input box disabled property to False
Text2.attr ("Disabled", false);
}
});
Summary: Later like this style of addition and modification can be this method text1.attr ("Disabled", "disabled"); Text2.removeattr ("Disabled");
The addition and deletion of DIV attributes on the page, whether the button is available