如何在 JavaScript 中搜索链接的 target 属性值?
要在 JavaScript 中搜索链接的 target 属性值,请使用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>
广告
数据结构
网络
关系型数据库管理系统
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP