PHP前端开发

如何在JavaScript中搜索链接的type属性的值?

百变鹏仔 4周前 (09-22) #HTML
文章标签 属性

要在 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>