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 对象。


相关文章


有用资源