I had a <li> list where the contents inside li should turn out to be bold when clicked. For this, I used the following code
HTML
<ul class="tabs"> <li><a href="#tab1" style="padding-left:5px;">All Sectors</a></li> <li><a href="#tab2">Information Technology</a></li> <li><a href="#tab3">Manufacturing</a></li> <li style="border-right:none;"><a href="#tab4">Services</a></li> </ul>
JQuery
$(document).ready(function() { $(".tabs li a").click( function() { $(this).css({ "font-weight" : "bold" }); } ); });
But When the list item is clicked, it becomes bold. I want the list item to return to its normal state when clicking on another list item . I can not find the correct event. Your help will be greatly appreciated.
javascript jquery html css
Rajasekar
source share