Javascript examples for DOM HTML Element:Footer
You can create a <footer> element by using the document.createElement() method:
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">create a FOOTER element containing a P element with some text</button> <script> function myFunction() {// ww w . j a v a 2 s. c o m var x = document.createElement("FOOTER"); x.setAttribute("id", "myFooter"); document.body.appendChild(x); var y = document.createElement("P"); var t = document.createTextNode("This is a p element in a footer element."); y.appendChild(t); document.getElementById("myFooter").appendChild(y); } </script> </body> </html>