programming-examples/js/Htmldom/Collect the value of href, hreflang, rel, target, and type attributes of a link.js
2019-11-15 12:59:38 +01:00

13 lines
683 B
JavaScript

function getAttributes()
{
var u = document.getElementById("w3r").href;
alert('The value of the href attribute of the link is : '+u);
var v = document.getElementById("w3r").hreflang;
alert('The value of the hreflang attribute of the link is : '+v);
var w = document.getElementById("w3r").rel;
alert('The value of the rel attribute of the link is : '+w);
var x = document.getElementById("w3r").target;
alert('The value of the taget attribute of the link is : '+x);
var y = document.getElementById("w3r").type;
alert('The value of the type attribute of the link is : '+y);
}