<分区>
当我调用 if (test.href != "https://www.test.com ") 时,它似乎给了我一个空值,但我不确定为什么,因为我希望它返回 URL
HTML
<p><a id="damn" href="https://www.test.com" target="_self">PC Install</a></p>
JS 脚本:
var test= document.getElementById("damn");
if (test.href != "https://www.test.com") {console.log(test)}