Javascript examples for DOM HTML Element:Superscript
The Superscript object represents an HTML <sup> element.
You can access a <sup> element by using getElementById():
<!DOCTYPE html> <html> <body> <sup id="mySup">this superscript text</sup> <button onclick="myFunction()">set the color </button> <script> function myFunction() {/*from w ww . j a v a 2 s. c om*/ var x = document.getElementById("mySup"); x.style.color = "red"; } </script> </body> </html>