Hello, maybe I've got this wrong but when I tested the toggle function I don't think I needed the .click function...

Try this :

<script type="text/javascript">
$(document).ready(function(e){
                $('a.typeswitch').toggle(
                  function () {
                    $(".typeselect").attr("selected","TV Shows");
                  },
                  function () {
                    $(".typeselect").attr("selected","Movies");
                  }
        );
});
</script>



Ben Shelock a écrit :
Im just starting out with jQuery. Im getting stuck though.

Im trying to get jQuery to manipulate my form. Changing the drop down
menus to a given value. It does the first toggle fine, but won't do
the second. Could someone explain why and provide a solution. Ive been
trying for hours.

Heres what Ive got.

<script type="text/javascript">
$(document).ready(function(e){
        $('a.typeswitch').click(function(e) {
                $('a.typeswitch').toggle(
                  function () {
                    $(".typeselect").attr("selected","TV Shows");
                  },
                  function () {
                    $(".typeselect").attr("selected","Movies");
                  }
        );
        });
});
</script>

Thanks :)



Reply via email to