HTML DOM address 对象
htmlweb developmentfront end technology更新于 2026/2/2 17:48:17
使用地址对象来表示 <address> 元素。让我们看一个创建 <address> 的示例 −
示例
<!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>
输出

现在,点击按钮显示地址 −

相关文章
有用资源
html 参考教程 - 该教程包含有关 html 的更多信息:https://www.cainiaomax.com/html/

