Create an Address Element - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Address

Introduction

You can create an <address> element by using the document.createElement() method:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<button onclick="myFunction()">Test</button>

<script>
function myFunction() {//from  w  w w .  ja va 2s.co m
    var x = document.createElement("ADDRESS");
    var t = document.createTextNode("this is the address");
    x.appendChild(t);
    document.body.appendChild(x);
}
</script>

</body>
</html>

Related Tutorials