I almost forgot in my last message, don't forget the return false; if
you don't want your link to lead anywhere ...
Something like this :
<script type="text/javascript">
$(document).ready(function(e){
$('a.typeswitch').toggle(
function () {
$(".typeselect").attr("selected","TV Shows");
return false;
},
function () {
$(".typeselect").attr("selected","Movies");
return false;
}
);
});
</script>
Ben Shelock a wrote:
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 :)