HTML DOM Ins 对象
htmldomweb developmentfront end technology更新于 2025/12/27 22:04:17
HTML DOM Ins 对象表示 HTML 文档的 <ins> 元素。
创建 ins 对象
语法
以下是语法 −
document.createElement(“INS”);
ins 对象的属性
| 属性 | 说明 |
|---|---|
| cite | 返回并修改 HTML 文档中 ins 元素的 cite 属性值。 |
| dateTime | 返回并修改 HTML 文档中 ins 元素的 cite 属性值。 |
让我们看一个 ins 对象的示例 −
示例
<!DOCTYPE html>
<html>
<style>
body {
text-align: center;
background-color: #fff;
color: #0197F6;
}
h1 {
color: #23CE6B;
}
</style>
<body>
<h1>DOM ins Object Demo</h1>
<button onclick="createIns()" class="btn">Create an ins object</button>
<script>
function createIns() {
var insElement = document.createElement("INS");
insElement.innerHTML = 'I\'m a <ins> element in HTML';
document.body.appendChild(insElement);
}
</script>
</body>
</html>
输出

点击“创建 ins 对象”按钮来创建 ins 对象。

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

