previous button jquery
<p>I have these two elements in my page:</p>

<pre><code>&lt;input type='button' value="undo" style="display:none" onClick = "undoFunction()"/&gt;
&lt;input type='checkbox'  onClick = "ajaxFunction()"/&gt;
</code></pre>

<p>I want when ever I click checkbox, undo button appears. I have used jquery but something is wrong. it doesn't work. </p>

<p>this is my whole function:</p>

<pre><code>function ajaxFunction(){
        $(document).ready(function(){
        $("form input:checkbox").click(function () {
            var hrefAdd = ($(this).nextAll('a').attr("href"));
            var word = savequery();
            var ajaxRequest;  // The variable that makes Ajax possible!
            try{
                // Opera 8.0+, Firefox, Safari
                ajaxRequest = new XMLHttpRequest();
                } catch (e){
                    // Internet Explorer Browsers
                    try{
                        ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
                        } catch (e) {
                            try{
                                ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
                                } catch (e){
                                    // Something went wrong
                                    alert("Your browser broke!");

                                    return false;
                                    }
                                }
                        }

                var queryString ="?Word=" + word + "&amp;Link_Add=" + hrefAdd  ;
                    ajaxRequest.open("GET","ajax_request.php" + queryString , true);
                    $(this).prev('input[type="button"]').show();
                    $(this).css("display","none");


                ajaxRequest.send(null);
                });
        });
}
</code></pre>
