<a class="btn">No Active</a>
<a class="btn">No Active</a>
<a class="btn active">Active</a>
.btn{
width:200px;
height:36px;
font-weight:bold;
line-height:36px;
background-color:#eee;
border-radius:4px;
text-align:center;
color:#999;
float:left;
margin:10px;
cursor:pointer;
}
.active{
background-color:#00bcac;
color:#fff;
}
$(function() {
$(".btn").click(function(){
if ($(this).hasClass("active")) {
//activeだったら
$(this).removeClass("active");
$(this).text("No Active");
} else if (!$(this).hasClass("active")) {
//activeじゃなかったら
$(this).addClass("active");
$(this).text("Active");
}
});
});
Also see: Tab Triggers