We know that when lab sets the for attribute, clicking the label will automatically set the corresponding checkbox Selected. However, the above settings will not select the checkbox when clicked on IE6/7.
A similar situation occurs with cellspacing/cellpadding. The summary is as follows: class for cellspacing cellpadding tabindex readonly maxlength rowspan colspan usemap frameborder contenteditable Therefore, when writing a common cross-browser interface method for setting element attributes, you need to consider the particularities of the above attributes in IE6/7. As follows
First of all, standard browsers directly use the original attribute names; secondly, IE6/7 attributes that are not listed above still use the original attribute names; Finally, these special attributes (with the same names as JS keywords such as for, class) use fixAttr. Okay, now you don’t need to consider className/htmlFor, just use class/for.
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn