Get Superscript Element - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Superscript


The Superscript object represents an HTML <sup> element.

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

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>

<sup id="mySup">this superscript text</sup>

<button onclick="myFunction()">set the color </button>

function myFunction() {/*from  w ww .  j a  v a  2  s. c  om*/
    var x = document.getElementById("mySup"); = "red";


Related Tutorials