Text Content

HTML <kbd> element

Build a form with the HTML form generator

Represents user input, commonly keyboard commands. It can also represent input through other devices. Use kbd for keys or other user inputs, not program output. Nested kbd can distinguish individual keys in a combination; samp describes the system response. It accepts global HTML attributes; individual global features may be inapplicable or restricted.

Formal Syntax & Structure

html syntaxhtml
<kbd>Input</kbd>

Return Value

HTMLElement

Content model: Phrasing content, with element-specific restrictions.

Working Example

Example Snippethtml
<!doctype html><html lang="en">  <head>    <meta charset="utf-8">    <title>HTML example</title>  </head>  <body>    <p>      Press      <kbd>Ctrl</kbd>      +      <kbd>S</kbd>      .    </p>  </body></html>
HTML Reference