Forum Moderators: open
According to this article on MSDN [msdn.microsoft.com], I think you should be able to... I haven't managed to get it to work yet though.
- Return Value [of the getAttribute() method]
Variant that returns a String, number, or Boolean value as defined by the attribute. If the attribute is not present, this method returns null.
Maybe if you tell us what you're trying to do with this information we can still help you out?
All I can think of is to check the actual HTML like
if (img.att=="" && indexOf(img.outerHTML, "ALT="))
javascript:(function(){function toArray (c){var a, k;a=new Array;for (k=0; k<c.length; ++k)a[k]=c[k];return a;}var images, img, altText;images=toArray(document.images);for (var i=0; i<images.length; ++i){img=images[i];altText=document.createTextNode(img.alt);img.parentNode.replaceChild(altText, img)}})();
ideas?
[edited by: tedster at 6:55 pm (utc) on April 8, 2003]