HTML <code> tag
The <code> tag is used to display computer code text.
Standard attributes
class, dir, id, lang, style, title, xml:lang
For more information on standard attributes, check out our HTML standard attributes reference page.
Event attributes
onclick, ondblclick, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup, onkeydown, onkeypress, onkeyup
For more information on event attributes, check out our HTML event attributes reference page.
Example
Here is some regular text
<code>Here is some computer code text</code>
What was that Javascript code again?
<code>document.write("Hello " + name + "!");</code>
Output:
Here is some regular text
Here is some computer code text
What was that Javascript code again?
document.write("Hello " + name + "!")