mortalc Posted March 17, 2011 Share Posted March 17, 2011 Can CSS keep up with changes?For example, I have a paragraph with className "red". I have a button which when clicked will change the className to "blue". If in my CSS it says that things with className "red" should be coloured red, and things with className "blue" should be coloured blue, will the text change colour on the click of the button? Link to comment Share on other sites More sharing options...
thescientist Posted March 17, 2011 Share Posted March 17, 2011 if you did it correctly it should. have you tried something that is not working like you expected?edit: I assume you mean that you are changing the class name using javascript... Link to comment Share on other sites More sharing options...
mortalc Posted March 17, 2011 Author Share Posted March 17, 2011 I tried it quickly in the "try it yourself" editor, and it didn't work. But I know that it's not a proper editor.But come think of it, I wrote a complicated webpage which seemed to work on it but not in reality... but I believe I know why, so it is irrelevant.Sorry, I'm rambling. I wrote a code for which it didn't work, and I wanted to make sure that it was not that but something else that was going wrong. Thanks! Link to comment Share on other sites More sharing options...
jeffman Posted March 17, 2011 Share Posted March 17, 2011 Post the code. Show us how it's bound to the button, too. It's not a 'submit' button, is it? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.