Changing text (link) color onclick with javascript

reemnNoupAppofe

New Member
I can not change the color of the text with js. Showing and Hiding div tags are working great but color can't be changed. btw, in my css file there are no styles for those links.HTML:\[code\] <ul> <li id="web_link"><a href="http://stackoverflow.com/questions/14584368/#">WEB</a></li> <li id="design_link"><a href="http://stackoverflow.com/questions/14584368/#">DESIGN</a></li> <li id="photo_link"><a href="http://stackoverflow.com/questions/14584368/#">PHOTO</a></li> </ul><div id="web_proekti"> Some elements</div><div id="design_proekti">Some elements </div> <div id="photo_proekti">Some elements </div>\[/code\]Javascript file:\[code\]$('#web_link').click(function(){ $('#web_proekti').show(); $('#design_proekti').hide(); $('#photo_proekti').hide(); $('#design_link').css('color','#999'); $('#photo_link').css('color','#999');});$('#design_link').click(function(){ $('#design_proekti').show(); $('#web_proekti').hide(); $('#photo_proekti').hide(); $('#web_link').css('color','#999'); $('#photo_link').css('color','#999');});$('#photo_link').click(function(){ $('#photo_proekti').show(); $('#design_proekti').hide(); $('#web_proekti').hide(); $('#design_link').css('color','#999'); $('#web_link').css('color','#999');});\[/code\]
 
Back
Top