HTML DOM Span Object

Span Object

The Span object represents the HTML <span> element.

Accessing Span Object

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

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

Try It Yourself

Create a Span object

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

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

Try It Yourself

Standard Properties and Events

The Span Object Supports StandardsPropertiesAndEvents.

Related Pages

HTML Tutorial:HTML Block

HTML Reference Manual:HTML <span> Tag