WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

HTML DOM Code Object


Code Object

The Code object represents an HTML <code> element.

Access a Code Object

You can access a <code> element by using getElementById():

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

Create a Code Object

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

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