TAG
JavaScript
Result
Run
License
<img id="myimg" src="http://resrc.devdic.com/img/bykind/alpha/150x135_flower.png" title="Yellow rose" />
window.addEventListener("load", () => { const elImg = document.querySelector("#myimg"); const aAttrNames = elImg.getAttributeNames(); aAttrNames.forEach(attr => { let val = elImg.getAttribute(attr); console.log(`${attr}="${val}"`); }); });
Console
expand_less
License
License
by DevDic
Close