Objeto de legenda HTML DOM
Objeto de legenda
O objeto Caption representa um elemento HTML <caption>.
Acessar um objeto de legenda
Você pode acessar um elemento <caption> usando getElementById():
Exemplo
var x = document.getElementById("myCaption");
Criar um objeto de legenda
Você pode criar um elemento <caption> usando o método document.createElement():
Exemplo
var x = document.createElement("CAPTION");
Dica: Você também pode criar um elemento <caption> usando o método createCaption do objeto Table.
Propriedades do objeto de legenda
Property | Description |
---|---|
align | Not supported in HTML5. Use
style.textAlign or
style.captionSide instead. Sets or returns the alignment of the caption |
Propriedades e eventos padrão
O objeto Caption também suporta as propriedades e eventos padrão .
Páginas relacionadas
Tutorial HTML: Tabelas HTML
Referência HTML: tag HTML <caption>
Referência JavaScript: objeto de tabela HTML DOM