HTML DOM Address Object


Use the address object to represent the <address> element. Let us see an example to create <address> −

Example

 Live Demo

<!DOCTYPE html>
<html>
<body>
<h2>Heading Two</h2>
<p>Create address element</p>
<button onclick="display()">Display</button>
<script>
   function display() {
      var a = document.createElement("Address");
      var node = document.createTextNode("ABC Inc, P 120, Ontario, Canada");
      a.appendChild(node);
      document.body.appendChild(a);
   }
</script>
</body>
</html>

Output

Now, click on the button to display the address −

Updated on: 12-Jun-2020

128 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements