<!DOCTYPE html>
<html>
<head>
<script>
function setcolor(e){
e.style["background-color"]=e.options[e.selectedIndex].style["background-color"];
}
</script>
</head>
<body>
<select onchange="setcolor(this);" >
<option>choose</option>
<option
style="background-color:red;"
>1</option>
<option
style="background-color:green;"
>2</option>
<option
style="background-color:blue;"
>3</option>
</select>
</body>
</html>
Comments
0 B
|👍
/👎