toggle between hide show along with anchor tag text in jquery

Posted by Ankitsrist under jQuery category on | Points: 40 | Views : 4312
i will explain you how to toggle hide show along with anchor tag text, i have made user comment box, where if user clicks on reply anchor comment box get open and anchor tag text now get change to close and vice versa, below is my html design along with jquery function
<script src="jquery/JScript1.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {

$("#reply").click(function() {

$("#replyuser").toggle(function() {
$(this).is(":visible") ? $("#reply").text("close") : $("#reply").text("reply");

<a id="reply" href="#">reply</a>
<div id="replyuser" style=" position:absolute;"><asp:TextBox ID="txt1" CssClass="txtbox" TextMode="MultiLine" runat="server"></asp:TextBox><br /><asp:Button ID="btnreply" Text="send" runat="server" CssClass="btn" /></div>

hope it will help

Comments or Responses

Login to post response