View Full Version : Edit styles with input?
02-05-2011, 03:36 AM
Is there any way that I can have multiple textboxes where the user can enter text (such as "black or green") and it would edit a css file, like this:
<input type="text" name="bg"/>
02-05-2011, 04:54 AM
I don't know that you can change the actual stylesheet with JS, but you can override it with a simple inline statement such as:
<input type="text" name="bgChange" value="" onblur="document.body.style.backgroundColor = this.value;" />
It would be better writing a function though because then you can override a bunch of styles at the same time.
Powered by vBulletin® Version 4.2.2 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.