
要正在JavaScript外搜刮链接的目的属性值,请运用target属性。你否以测验考试运转下列代码以猎取方针属性的值。
事例
<!DOCTYPE html>
<html>
<body>
<p><a id = "qriesid" target="_self" href = "https://qries.com/" type = "text/html" >Qries</a></p>
<script>
var x = document.getElementById("qriesid").target;
document.write("Value of the target attribute: "+x);
</script>
</body>
</html>登录后复造
以上即是假定正在JavaScript外搜刮链接的目的属性的值?的具体形式,更多请存眷萤水红IT仄台另外相闭文章!

发表评论 取消回复