This is the css i'm trying to apply to all the keywords
#showKeywords {
background-color:#5B1762;
}
What i want to do is when you click the showKeywords button the keywords are highlighted. However instead of highlighting the keywords it applies the css style to the button. I notice that the id of the button and the name of the css style are the same. How can I change the .keyword class without changing the button (showKeywords) style
$(document).ready(function() {
$("#showKeywords").click(function() {
$(".keyword").addClass("showKeywords");
});
<div id="menuDiv">
<span id="showVariables" class="button">Variables</span>
<span id="showKeywords" class="button">Keywords</span>
</div>
<br>
<span class="keyword">public</span>
<span class="keyword">static</span>
<span class="keyword">void</span> main(String args[]) {
I'm not allowed to change the name of the #showKeywords or I would have done that.