How do I get click outside and font normal in jQuery?
When I click an element it should be bold until I click another text element.
When clicked to any element then rest of the elements shouldn’t be bold at the same time.
How can I do this in Javascript function?
Code I am using-
$('.muon-no-submenu ').click(function () {
$(this).addClass("muon_click");
});
Class-
.muon-no-submenu
{
font-weight:bold;
}
Bold texts remain even if I click another tab.
The HTML for your structure would be helpful. Even-so, I think I understand what you want..
Remove the class from where it has already been (potentially) added and then add it to the one being clicked. Assuming all of your tabs have the class
.muon-no-submenu:Here is a somewhat related JSFiddle