Use the address object to represent the <address> element. Let us see an example to create <address> −
Example
<!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 −