javascript createCaption() method


  Translation results:

create

UK[kriˈeɪt] 美[kriˈet]

vt. To produce; to create, to create; to ennoble, to ennoble...(noble)

vi.[English][Slang] Lose your temper, complain

Third person singular: creates Present participle: creating Past tense: created Past participle: created

caption

UK[ˈkæpʃn] US[ˈkæpʃən]

n. Subtitle; title, caption, subtitle; third file

vt. Give (picture , photos, etc.) add captions; add captions to (documents, etc.); add subtitles to...

Third person singular: captions Plural: captions Present participle: captioning Past tense: captioned Past participle: captioned

javascript createCaption() methodsyntax

Function:Create a caption element for the table.

Syntax: tableObject.createCaption()
Returns: Returns an HTMLElement object representing the <caption> element of the table. If the table already has a title, return it. If the table has no <caption> element, create a new, empty <caption> element, insert it into the table, and return it.

javascript createCaption() methodexample

<html>
<head>
<script type="text/javascript">
function createCaption()
{
var x=document.getElementById('myTable').createCaption()
x.innerHTML="My table caption"
}
</script>
</head>
<body>

<table id="myTable" border="1">
<tr>
<td>Row1 cell1</td>
<td>Row1 cell2</td>
</tr>
<tr>
<td>Row2 cell1</td>
<td>Row2 cell2</td>
</tr>
</table>
<br />
<input type="button" onclick="createCaption()"
value="Create caption">

</body>
</html>

Run instance »

Click the "Run instance" button to view the online instance

Home

Videos

Q&A