Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!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>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement