JSFiddle - React, Tailwind, and code Playground
by GaryC123
HTML
<table cellspacing="7" cellpadding="0" border="0">
<tr>
<td width="60" align="left">View:</td>
<td width="100"align="left"><a><span class="off"></span>All Types</a></td>
<td width="113" align="left"><a><span class="off"></span>On Demand</a></td>
<td width="101" align="left"><a><span class="off"></span>Webinars</a></td>
<td width="141" align="left"><a><span class="off"></span>Seminars</a></td>
</tr>
</table>
CSS
table a span {
display:inline-block;
height:20px;
width:20px;
border:1px solid blue
}
table a span.off {
background:url("images/orange_off.png") red
}
table a span.on {
background:url("images/orange_on.png") green
}
JavaScript
$("table a span").click(function(){
$("table a span").removeClass("on")
$(this).toggleClass("on")
})
$("table a span:eq(0)").toggleClass("on")