toggleClass confusion
toggleClass confusion
I'm probably just being really thick but i'm confused about this...
click
specifically:
$('#foo').toggleClass(className, addOrRemove);
I basically want it so that when my <div class="unselected"> is clicked, it becomes 'selected'. and vice versa
what i have is:
$(document).ready(function () {
$('#mydiv').click(function () {
$('#mydiv').toggleClass('selected');
});
});
That adds and removes 'selected' from the DIV but i want it to switch between 'unselected' and 'selected'...
Thanks for any help,
Max
Topic Participants
maxhenchman
jay.blanchard