ShadowMage Posted January 7, 2010 Share Posted January 7, 2010 Hi,Is there a way to change a class in CSS. I don't want to change the class of an element, I know that can be done. What I want is to target an actual CSS class, for example: .toggleElement {visibility: hidden;} I have several elements with class='toggleElement' and I want to be able to change the class toggleElement to set visibility: visible without having to access every element with that class name. Is this even possible?Thanks in advance,jkloth Link to comment Share on other sites More sharing options...
justsomeguy Posted January 7, 2010 Share Posted January 7, 2010 There's a script to do that here:http://www.shawnolson.net/a/503/altering-c...javascript.html Link to comment Share on other sites More sharing options...
ShadowMage Posted January 7, 2010 Author Share Posted January 7, 2010 There's a script to do that here:http://www.shawnolson.net/a/503/altering-c...javascript.html Thanks, I'll give it a shot.{edit} **Beautiful!! Works like a charm! Thanks for the reference, jsg! Link to comment Share on other sites More sharing options...
ApocalypeX Posted January 10, 2010 Share Posted January 10, 2010 jQuery? Link to comment Share on other sites More sharing options...
justsomeguy Posted January 10, 2010 Share Posted January 10, 2010 jQuery can do that also, but it may be overkill to include all of jQuery just to change a class. Link to comment Share on other sites More sharing options...
ApocalypeX Posted January 12, 2010 Share Posted January 12, 2010 jQuery can do that also, but it may be overkill to include all of jQuery just to change a class.Then couldn't document.getElementById('blam').class = "visible class"; have been used? Link to comment Share on other sites More sharing options...
Synook Posted January 12, 2010 Share Posted January 12, 2010 ... I don't want to change the class of an element, I know that can be done. What I want is to target an actual CSS class... Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.