The <kbd> tag is used to define the keyboard input. Use this when you want the user to type on their keyboard, for example, shortcut keys Ctrl+C for copy, Esc for exit, etc. Let us now see an example to implement the <kbd> tag −
Example
<!DOCTYPE html> <html> <body> <h2>Shortcut Keys</h2> <p>Use the following shortcut keys − </p> <p><strong>Cut</strong> − <kbd>CTRL</kbd>+<KBD>X</kbd></p> <p><strong>Copy</strong> − <kbd>CTRL</kbd>+<KBD>C</kbd></p> <p><strong>Paste</strong> − <kbd>CTRL</kbd>+<KBD>V</kbd></p> <p><strong>Undo</strong> − <kbd>CTRL</kbd>+<KBD>Z</kbd></p> </body> </html>
Output
In the above example, we have set some shortcut keys −
<strong>Cut</strong> − <kbd>CTRL</kbd>+<KBD>X</kbd>
The shortcut key is set using the <KBD> element, for example, CTRL + X :
<kbd>CTRL</kbd>+<KBD>X</kbd>