```
<script type="text/javascript">

    $(function () {

        var text3;
        $('.HideButton').click(function () {

            text3 = $('#MessageText').text;

            var theButton = $(this);

            $('#disclaimer').slideToggle('slow', function () {
                theButton.val($(this).is(':visible') ? 'Hide' : 'Show');
            });

            $('<p>' + text3 + '</p>').addClass("new").insertAfter('#disclaimer');
            return false;

        });

    });

```

updated...code above doesnt change the buttons text

```
<p id="disclaimer" > DDDDDDDDDDDDDDDDDDDDDDDDDD</p>
<asp:Button ID="Button1" CssClass="HideButton" runat="server" Text="Hide" />

```

I want the text of the button to change each time i press on it..But it doesnt

```
<p  id="disclaimer"  > 

    <input id="MessageText" type="text" />

</p>

<asp:Button ID="Button21" CssClass="HideButton" runat="server" Text="Hide" />

```

As message typed in the textbox..it should appear while "#disclaimer disappear