# Javascript $get() function



## sengfoh (May 23, 2008)

can anyone help me... Why these code don't work

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Chat Room</title>

<script language="javascript" type="text/javascript">
function UpdateMessages(result)
{
$get("txt").value=$get("txt").value+result;
$get("txt").doScroll();
}
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div>
<asp:textbox runat="server" TextMode="MultiLine" id="txt" style="WIDTH: 690px; HEIGHT: 260px" rows="16" Columns="79" ></asp:textbox>
<input id="Button1" onclick="UpdateMessages('AAA')" type="button" value="SEND"/>
</div>
</form>
</body>
</html>


----------



## jamiemac2005 (Jul 5, 2007)

They wont work because $get returns a string not an object so $get().value doesn't exist. 

Whats the intention of this? what does $get("txt") return?

Cheers,
Jamey


----------

