removeAttribute doesn't seem to do so.
I am trying to do this in an <img id='player' src=' ' alt='alt' title='title' border='0' onerror="document.getElementById('player').removeAttribute('src');document.getElementById('player').removeAttribute('alt');document.getElementById('player').removeAttribute('title');" /> tag.
When I view Generated Source in FF2 (Web Developer 1.1.9), the attributes are not shown in the source listing, and the title attribute still displays in the page.
When I view Generated Source in FF4, the attributes are present in the source listing, and the title attribute still displays on the page.
briansmither tarafından
Tüm Yanıtlar (1)
(In my original post above, I had to use a space as the value for the src attribute, otherwise this editor would not show it. But my actual code is a zero-length string.)
I believe that FF4 does not consider a zero-length string as a triggerable error. I change the src attribute's value to '#' and all is working as desired.
briansmither tarafından