Implementation of the disable of HTML elements supported by IE in netscape4.76 1. Related HTML elements (1) text, edit, password, textarea (2) Radio, checkbox (3) select2. IE (1) document.form_ name.text_name.disabled = true;document.form_name.edit_name.disabled = True;document.form_name.password_ name.disabled = True;document.form_name.textarea_name.disabled = true; (2) Document.form_name.radio_name [i].disabled = True;document.form_name.checkbox_name[i].disabled = true; (3) document.form_name.select_ name.disabled = true;3. Netscape4.76 (1) Document.form_name.text_ name.disabled = true;document.form_name.edit_name.disabled = True;document.form_name.password_name.disabled = true; Add a method for focus event handling on the corresponding text, edit, password, textarea elements: onfocus= "disableelements (This)" function disableelements (obj) { if (obj.disabled) { Obj.blur (); }} (2) document.form_name.radio_name[i]. Disabled = True;document.form_name.checkbox_name[i].disabled = true; add a method to handle the MouseDown event on the corresponding radio, on the checkbox element: O nclick= "return disableelements (This)" function disableelements (obj) {if (obj.disabled) { obj.checked=false; return false;; } (3) document.form_name.select_name.disabled = true; Add a method to handle the change event on the corresponding SELECT element: onchange= "disableelements (This)" function disableelements (obj) { if (obj.disabled) { for (Var i= 0; i<obj.options.length; i++) { obj.options[i].selected = obj.options[i].frozenstatus; (oBj.options[i].selected = false; This can be written as well.) } }} Finally I enclose an example, this example is tested under IE6.0 and Netscape4.76 through!
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.