Get Mark Element - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Mark

Introduction

The Mark object represents an HTML <mark> element.

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

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<mark id="myMark">this marked text</mark>

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

<script>
function myFunction() {// w  ww  . j  a  v a  2  s  . com
    var x = document.getElementById("myMark");
    x.style.fontSize = "x-large";
}
</script>

</body>
</html>

Related Tutorials