TaboTabo
02-23-2007, 01:21 PM
I made this code so that when a user enters a colour the colour of the "preview" text changes
Colour: <input type="text" size="10" onkeyup="colourpreview.color=this.value" onchange="colourpreview.color=this.value">
<font id="colourpreview">Preview</font>
It works fine, however when i want to do the same thing with elements that use style, for example the highlight colour:
<span style="background-color: colour">ss</span>
Can you write me the script and change it so that it canges the background colour of the Preview text?
Preferably do it like this:
<span id="bgcolourid"><font id="colourpreview">Preview</font><span>
ALso is it possible for you to make the codes so that they work with dropdown boxes??
<option>Colour here</option>
Colour: <input type="text" size="10" onkeyup="colourpreview.color=this.value" onchange="colourpreview.color=this.value">
<font id="colourpreview">Preview</font>
It works fine, however when i want to do the same thing with elements that use style, for example the highlight colour:
<span style="background-color: colour">ss</span>
Can you write me the script and change it so that it canges the background colour of the Preview text?
Preferably do it like this:
<span id="bgcolourid"><font id="colourpreview">Preview</font><span>
ALso is it possible for you to make the codes so that they work with dropdown boxes??
<option>Colour here</option>