开发者

How do you access non-standard attributes in Firefox JavaScript?

Basically in IE you can do something like this:

<img metaDataAtt="type5" src="..." id="tag1"/>

and then in the JavaScript do something like

var theImg = document.getElementById("tag1");
alert(theImg.metaDataAtt);

However, in firefox you can't. Is there some sort of hack to get around this?

Thanks, 开发者_开发问答Grae


document.getElementById('tag1').getAttribute('metaDataAtt');
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜