如何在 JavaScript 中搜索链接的 type 属性值?
htmljavascriptprogramming scripts更新于 2026/1/14 20:28:17
要在 JavaScript 中搜索链接的 type 属性值,请使用 type 属性。您可以尝试运行以下代码来获取 type 属性的值。
示例
<!DOCTYPE html>
<html>
<body>
<p><a id = "qriesid" href = "https://qries.com/" type="text/html" >Qries</a></p>
<script>
var x = document.getElementById("qriesid").type;
document.write("Value of the type attribute: "+x);
</script>
</body>
</html>
相关文章
有用资源
html 参考教程 - 该教程包含有关 html 的更多信息:https://www.cainiaomax.com/html/

