[英]How do you access non-standard attributes in Firefox JavaScript?
基本上在IE中,您可以執行以下操作:
<img metaDataAtt="type5" src="..." id="tag1"/>
然后在JavaScript中執行類似
var theImg = document.getElementById("tag1");
alert(theImg.metaDataAtt);
但是,在Firefox中不能。 是否有某種解決方法?
謝謝Grae
document.getElementById('tag1').getAttribute('metaDataAtt');
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.