I have main.aspx and second.aspx.The code in main.aspx:
<form id="form1">
<div id="main">
</div>
</form>
And in second.aspx:
<div id="second">
<asp:Textbox runat="server" id="txt1"></asp:Textbox>
<input type="button" id="bttn" value="send"></input>
</div>
At the run time I'm loading second.aspx page into main.aspx div id="main".
$("#main").load("second.aspx #second");
I'm trying to get the textbox value from main.aspx.But when I tried
$("#bttn").click(function(){
var t=$("txt1").val();
alert(t);
});
It gives nothing.It seems to be never going into the function.How can get the value from the textbox.