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

廣告
資料結構
網路
RDBMS
作業系統
Java
iOS
HTML
CSS
Android
Python
C 程式設計
C++
C#
MongoDB
MySQL
Javascript
PHP