methodmanstyle
New Member
I have black text that when double clicked, changes to a different color. I want it to be able to change back to black on a double click. Right now, I have:\[code\]<script><h1 id="color"> I CHANGE COLORS! </h1><a href="javascript:void(0)" ondblclick=" counter++; if(counter%2==1){color()} else {black()} ">Double click here</a></script>\[/code\]The two functions called are \[code\]color()\[/code\] and \[code\]black()\[/code\]. Is there anyway I can use a toggle instead of this if-else with javascript?