หากต้องการค้นหาค่าของแอตทริบิวต์ type ของลิงก์ใน JavaScript ให้ใช้คุณสมบัติ 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>