<script language="javascript" type="text/javascript">
function mozilla_wahl() {document.forms[0].elements[0].style.backgroundColor = document.forms[0].mozilla.options[document.forms[0].mozilla.selectedIndex].value;}document.write('<selectname="mozilla" onchange="mozilla_wahl(this.value)">'
+ '<option value="black" style="color:black">&#x2588;&#x2588; Schwarz'
+ '<option value="maroon" style="color:maroon">&#x2588;&#x2588; Rotbraun'
+ '</select>');
</script>
 
TESTEN
<script language="javascript" type="text/javascript">
 
function mozilla_wahl() {
document.nrf.testb.style.backgroundColor = document.nrf.mozilla.options[document.nrf.mozilla.selectedIndex].value;
}
</script>
 
<form action="" name="nrf" method="post">
<input type="button" id="testb" name="test" value=" Test Button " style="width:150px;">
<br>
Für Mozilla:<br>
<select name="mozilla" onChange="mozilla_wahl(this.value)" style="width:150px;">
<option value="#FFFF00" style="background-color: #FFFF00;">Gelb
<option value="#FF0000" style="background-color: #FF0000;">Rot
<option value="#0000FF" style="background-color: #0000FF;">Blau
</select>
</form>
Änderungen – BS-Wiki: Wissen teilen

Änderungen