Reputation: 903
I tried like this
<script type="text/javascript">
$(document).ready(function () {
$('#divID').hide();
$('#txtInsertComments').Onfocus(function () {
$('#divID').show(); });
});
</script>
//Asp.net Design
<asp:TextBox ID="txtInsertComments" runat="server" Text="Demo"></asp:TextBox>
<div runat="server" id="divID">
This is Div
</div>
but still not working... please help me out ...
Upvotes: 2
Views: 2077
Reputation: 6996
If you are using this with Master Page
then the ID of your Textbox
will change.So use this.
$('<%txtInsertComments.ClientID%>').focus(function () {
$('#divID').show(); });
});
If you are not using Master Page
then this should work
$('#txtInsertComments.ClientID').focus(function () {
$('#divID').show(); });
});
Upvotes: 1