中文字幕一区二区人妻电影,亚洲av无码一区二区乱子伦as ,亚洲精品无码永久在线观看,亚洲成aⅴ人片久青草影院按摩,亚洲黑人巨大videos

Table createCaption() 方法

Table 對象參考手冊 Table 對象

定義和用法

createCaption() 方法用于在表格中獲取或創(chuàng)建 <caption> 元素。

注意:如果 caption 元素在表格中已經(jīng)存在, createCaption() 方法返回已經(jīng)存在的標題,而不是新建一個<caption> 元素。

提示: 移除表格的 caption 元素,請使用 deleteCaption() 方法。

語法

tableObject.createCaption()

瀏覽器支持

Internet ExplorerFirefoxOperaGoogle ChromeSafari

所有主要瀏覽器都支持 createCaption() 方法


實例

實例

下面的例子為表格創(chuàng)建了一個標題:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>小白教程(json.cn)</title>
<script>
function displayResult(){
????var x=document.getElementById("myTable").createCaption();
????x.innerHTML="<b>我的表格標題</b>";
}
</script>
</head>
<body>

<table id="myTable" border="1">
????<tr>
????????<td>cell 1</td>
????????<td>cell 2</td>
????</tr>
????<tr>
????????<td>cell 3</td>
????????<td>cell 4</td>
????</tr>
</table>
<br>
<button type="button" onclick="displayResult()">創(chuàng)建一個表格標題</button>

</body>
</html>

運行代碼 ?

Table 對象參考手冊 Table 對象其他擴展