SO - 15519857
by firegroove
HTML
<input type="button" id="btn" value="button" class="topcoat" />
JavaScript
$(function() {
$('#btn').click(function() {
var $this = $(this);
if ($this.is('.topcoat')) {
$this.toggleClass("topcoat on");
alert("1");
} else if ($this.is('.on')) {
$this.toggleClass("on off");
alert("2");
} else if ($this.is('.off')) {
$this.toggleClass("off topcoat");
alert("3");
}
})
})