HTML Tag


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

 Live Demo

<!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>

Updated on: 30-Jul-2019

120 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements