The selector
.class 1
actually looks for an element
1
inside an element with
class
as class. And
class="class 1"
actually sets
two classes on the element:
class
and
1
. That's not what you intend, so use
class="class_1"
(or anything without spaces) and
$(".class_1")
.
And to disable the styles afterwards, instead of using
.css
I'd create a CSS class with your style, and use
toggleClass[
^] inside the click handler.