Đối tượng theo dõi DOM HTML
Theo dõi đối tượng
Đối tượng Track đại diện cho một phần tử HTML <track>.
Truy cập một đối tượng theo dõi
Bạn có thể truy cập phần tử <track> bằng cách sử dụng getElementById ():
var x = document.getElementById("myTrack");
Tạo một đối tượng theo dõi
Bạn có thể tạo một phần tử <track> bằng cách sử dụng phương thức document.createElement ():
var x = document.createElement("TRACK");
Theo dõi thuộc tính đối tượng
Property | Description |
---|---|
default | Sets or returns the default state of the track |
kind | Sets or returns the value of the kind attribute of the track |
label | Sets or returns the value of the label attribute of the track |
readyState | Returns the current state of the track resource |
src | Sets or returns the value of the src attribute of the track |
srclang | Sets or returns the value of the srclang attribute of the track |
track | Returns a TextTrack object representing the track element's text track data |
Thuộc tính và sự kiện tiêu chuẩn
Đối tượng Track cũng hỗ trợ các thuộc tính và sự kiện tiêu chuẩn .
Các trang liên quan
Tham chiếu HTML: thẻ <track> HTML