function you(){ var a = document.getElementsByTagName("input")[0]; var b = a.getAttribute("value"); alert(b) }