HTML <kbd> Tag

HTMLWeb DevelopmentFront End Technology

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 −


 Live Demo

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


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 :

Published on 18-Jun-2019 13:58:48