<!DOCTYPE html>
<html>
<body>
<script>
function show()
{
var a=document.getElementById("compuhelp").value;
alert("value is="+a);
}
</script>
Name<input type="text" name="txt_1" id="compuhelp" />
<input type="button" onblur="show()" value="show" />
</body>
</html>
This example demonstrates the getElementsByTagId
Type the value and click the text box..