Goose Posted March 6, 2006 Share Posted March 6, 2006 Basically I want a javascript to change a property in a css class. I know the class name and I have the property and the value I need to change the property to. Is there a way that javascript can edit the class and then all the objects that hold that class refresh so that they reflect the new values?Thanks.Edit: If anyone can just post an example snippet of code, that would be awesome. The class name that I want to edit is named "trow" and the property I want to edit is "display" and I want to set it to "none". Quote Link to comment https://forums.phpfreaks.com/topic/4238-javascript-and-css-classes/ Share on other sites More sharing options...
fooDigi Posted March 10, 2006 Share Posted March 10, 2006 i think all you have to do is have two different classes... one with display:none, one with display:block, and have everything you need to change have the same id. then use document.getElementById(yourid).className = 'off' ... or whatever. try it. seems correct. Quote Link to comment https://forums.phpfreaks.com/topic/4238-javascript-and-css-classes/#findComment-16087 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.