I've stumpled upon a strange behavior in IE(6/7/8) that drives me nuts. Given the following markup:
<input type="text" value="foo" class="bar" cache="yes" send="no" />
Please note that the cache
attribute is set to yes
. However IE somehow manages to change the attributes value to cache="cache"
when rendering the DOM.
So, I wonder, is there an undocumented feature that I'm not aware of? I've googled about an hour now but couldn't find any info on this (not even on MSDN).
NOTE
I'm aware that adding custom attributes is non-standard compliant and that boolean attributes should be noted asattribute="attribute"
. Nevertheless I have to cope with these as they were introduced long before I joined the team. These custom attributes are used in conjunction with javascript to provide a more user friendly approach 开发者_高级运维to form handling (and it works out quite well with Firefox/Safari/Opera/Chrome).
I know that I could simply convert these custom attributes to x-data attributes that will be introduced with HTML5 but that would take me several hours of extra work - sigh.
Hope, I made myself clear. Thanks in advance.
For ages, it has been that boolean attributes are preferrably written as <input type="checkbox" checked="checked"/>
etc. This is because in the dinosaur age, you were supposed to only write <input type="checkbox" checked/>
and assigning the same value as the property name broke the fewest legacy browsers, while still making the markup XML-compliant.
精彩评论