|
November 21, 2000 Removing Attributes Tips: November 2000
Yehuda Shiran, Ph.D.
|
|
Netscape 6 supports some DOM capabilities
that Internet Explorer does not. One of them is removing attributes from elements
that won't work with Internet Explorer. Specifically, applying the removeAttribute()
method to the BODY
element works well in Netscape 6 but doesn't work in Internet Explorer 5.5. This
tip is colored yellow by assigning the BODY
attribute, <BODY BGCOLOR="yellow">.
We remove this background color by the following script:
You can see that the background
color is still yellow in Internet Explorer 5.5 and lower, but is white in Netscape
6. The reason being that the This deficiency in Internet
Explorer 5.x does not apply to all element type and attribute combinations.
Internet Explorer can remove attributes from other elements, such as the
Notice that you need to specify
the attribute names in lowercase.
People who read this tip also read these tips: Look for similar tips by subject: |