Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <html>
- <head>
- <script type="text/javascript">
- function changecolour()
- {
- document.getElementById("box").style.background = document.getElementById("colour").value;
- }
- </script>
- </head>
- <body>
- <div id="box" style="width:100px; height:100px; border:1px solid #000;"></div><br />
- <input type="text" value="#aa0000" id="colour" /><input type="button" value="Click it!" onclick="changecolour();" />
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement