Get Cite Element - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Cite

Introduction

The Cite object represents an HTML <cite> element.

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

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<p><cite id="myCite">CSS</cite> this is a test</p>

<button onclick="myFunction()">set the color of the citation to red</button>

<script>
function myFunction() {//from www.java2s .  c o m
    var x = document.getElementById("myCite");
    x.style.color = "red";
}
</script>

</body>
</html>

Related Tutorials