Javascript examples for CSS Style Property:backgroundColor
Handle Button Onclick to change its background color
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> function derp() {/* w w w . java2 s .co m*/ document.activeElement.style.backgroundColor = '#B2DD28'; } </script> </head> <body> <button type="button" onclick="derp()">time:</button> <button type="button" onclick="derp()">length:</button> <button type="button" onclick="derp()">position:</button> </body> </html>