HTML DOM Ins 物件


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 物件。

更新於: 2019 年 9 月 27 日

158 次瀏覽

開啟您的 職業生涯

透過完成課程獲得認證

開始
廣告