Get S Element - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:S


The S object represents an HTML <s> element.

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

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>

<p><s id="myS">My car is blue.</s></p>

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

<p id="demo"></p>

function myFunction() {//from w w w. j a v a2s.c om
    var x = document.getElementById("myS"); = "red";


Related Tutorials