<script type="text/javascript"> var d = document.getElementById("d"); function setProperty(){ var set = document.getElementById("setColor"); var optionValue = set.options[set.selectedIndex].value; d.style.backgroundColor = optionValue; } function reset(){ d.style.backgroundColor = "transparent"; } </script>