Do not undertand why I can not get the attribute value of tag element by using function getElementsByTagName
.
Also I have no problems with using direct acsess to the element by id
, like t.getAttribute('href')
from <a id="t">.</a>
var a = document.body.getElementsByTagName('a').getAttribute('href');
console.log(a);
<a href="###">http://internal.com/</a>