发布网友 发布时间:2022-04-20 15:41
共1个回答
热心网友 时间:2022-04-27 05:49
<script> var testEle = document.getElementById("test"); testEle.setAttribute("demo"); </script> <a href="#" id="test" demo="1" onclick="alert(this.attributes['demo'].nodeValue)">(1)有</a> <a href="#" id="test" demo="2" onclick="alert(this.attributes['demo'].nodeValue)">(2)无</a>