Get Small Element - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Small

Introduction

The Small object represents an HTML <small> element.

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

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<small id="mySmall">this small text</small>

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

<script>
function myFunction() {//from  w w  w.  jav a2  s . com
    var x = document.getElementById("mySmall");
    x.style.color= "red";
}
</script>

</body>
</html>

Related Tutorials