Hi! I want to transfer the value of text box (name_txt) into variable var1, but there is some error. Please! Help me out.

<script language="javascript" type="text/javascript" >
<!--
function my()
{
var var1;
var1=document.getElementsByName(name_txt);
document.write(var1);
}
-->
</script>
<input id="Text1" type="text" name="name_txt" />
<input id="Button1" type="button" value="button" onclick="my()"/>

</div>
Thanx