Javascript examples for DOM HTML Element:Kbd
The Kbd object represents an HTML <kbd> element.
You can access a <kbd> element by using getElementById():
<!DOCTYPE html> <html> <body> <kbd id="myKbd">Keyboard input</kbd> <button onclick="myFunction()">set the color of the kbd element</button> <script> function myFunction() {/* ww w . jav a 2 s . c o m*/ var x = document.getElementById("myKbd"); x.style.color = "red"; } </script> </body> </html>