Get Footer Element - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Footer

Introduction

The Footer object represents an HTML <footer> element.

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

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<footer id="myFooter">
  <p>Some text in footer.</p>
</footer>/*w  w w .  j  ava 2  s  .  co  m*/

<button onclick="myFunction()">get the content of the footer element</button>

<p id="demo"></p>

<script>
function myFunction() {
    var x = document.getElementById("myFooter").innerHTML;
    document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>

Related Tutorials