Get Strong Element - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Strong

Introduction

The Strong object represents an HTML <strong> element.

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

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<strong id="myStrong">this strong text</strong>

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

<script>
function myFunction() {//from  w w w .j ava2  s . co  m
    var x = document.getElementById("myStrong");
    x.style.color = "red";
}
</script>

</body>
</html>

Related Tutorials