Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
HTML DOM Span object
The HTML DOM span object is associated with the HTML element. We can create and access span element using the createElement() and getElementById() method respectively.
Syntax
Following is the syntax for ?
Creating a span object ?
var a = document.createElement("SPAN");
Example
Let us look at an example for the span object ?
Span object example
Create a span element by clicking the below button
This is some text inside a p element
Output
This will produce the following output ?

On clicking the CREATE button ?

Advertisements
