views:

47

answers:

1

hi,

<asp:Button ID="Button1" runat="server" Text="Button"  OnClientClick ="toggletr();"  />

<script   type ="text/javascript" >

function toggletr()
{
debugger;
var Inputs =$get("TextBox1");
}
</script>

i trying this i am getting error:

Microsoft JScript runtime error: Object expected

but in textbox it contains value

//var Inputs = document .getElementById ("TextBox1");

if i do like this i am getting the value. can any one tell me how to solve this one in javscript using $get() or JQuery how to assign value

thank you

A: 

Also make sure the definition of the toggletr function appears earlier in the document than calls to it. Try it with the toggletr function defined in the <head> section of your page if it isn't already.

Peter McGrattan