Phương thức Table deleteCaption()

Định nghĩa và cách sử dụng

deleteCaption() Phương thức từ bảng xóa phần tử đầu tiên Phần tử <caption>và nội dung của nó).

Lưu ý:Để tạo một phần tử <caption> mới cho bảng, hãy sử dụng Phương thức createCaption().

Xem thêm:

Hướng dẫn HTML:Thẻ HTML <caption>

Mô hình

Ví dụ 1

Xóa元素 <caption> khỏi bảng:

document.getElementById("myTable").deleteCaption();

Thử ngay

Ví dụ 2

Tạo và xóa元素 <caption>:

function myCreateFunction() {
  var table = document.getElementById("myTable").createCaption();
  table.innerHTML = "<b>My table caption</b>";
{}
function myDeleteFunction() {
  document.getElementById("myTable").deleteCaption();
{}

Thử ngay

Cú pháp

tableObject.deleteCaption()

Tham số

Không.

Giá trị trả về:

Không trả về giá trị.

Hỗ trợ trình duyệt

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Hỗ trợ Hỗ trợ Hỗ trợ Hỗ trợ Hỗ trợ