Get S Element - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:S

Introduction

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>
<html>
<body>

<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>

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

</body>
</html>

Related Tutorials