Get Kbd Element - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Kbd


The Kbd object represents an HTML <kbd> element.

You can access a <kbd> element by using getElementById():

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>

<kbd id="myKbd">Keyboard input</kbd>

<button onclick="myFunction()">set the color of the kbd element</button>

function myFunction() {/*  ww w . jav a  2  s . c  o  m*/
    var x = document.getElementById("myKbd"); = "red";


Related Tutorials