Hiding and showing button on click in twitter bootstrap

I have the following jQuery and css that I've used previously and worked, however in the new solution (which is a copy of the existing one) this does not work:

                <script>

                    $("#inprogress_btn").click(function () {
                        if (!($("#inprogress_btn").is(":visible"))) {
                            $("#onhold_btn").show();
                            $("#inprogress_btn").hide();
                        }
                        else {
                            $("#onhold_btn").hide();
                            $("#inprogress_btn").show();
                        }
                    })
                </script>

        <button style="margin-top:50px;" id="onhold_btn" class="btn btn-block btn-danger">On Hold</button>
        <button id="inprogress_btn" class="btn btn-block btn-success">In Progress</button>

What I am doing wrong?

Answers


it worked, please checkout jsfiddle, it reference jQuery 1.10.1, hope helps.

$(function(){
    $("#inprogress_btn").click(function () {
               if (!($("#inprogress_btn").is(":visible"))) {
                    $("#onhold_btn").show();
                    $("#inprogress_btn").hide();
                }
                else {
                    $("#onhold_btn").hide();
                    $("#inprogress_btn").show();
                }
            });
})

Need Your Help

Remove a Reference from the Release configuration without removing it from the Debug Configuration

xamarin xamarin-studio

How can I add a Reference (in the References folder) to the Debug Configuration without adding it to the Release Configuration?

Bind data in json to a select box in AngularJs

angularjs ng-options

I am looking for a way to bind data from a multidimensional array in the scope with my view.