HTML DOM Code Object

Code object

The Code object represents the HTML <code> element.

Access Code object

You can use getElementById() to access the <code> element:

var x = document.getElementById("myCode");

Try It Yourself

Create Code object

You can use the document.createElement() method to create a <code> element:

var x = document.createElement("CODE");

Try It Yourself

Standard Properties and Events

Code Object Supports StandardsPropertiesAndEvents.

Related Pages

HTML Tutorial:HTML Text Formatting Elements

HTML Reference Manual:HTML <code> Tag