Document: thuộc tính characterSet
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
Thuộc tính chỉ đọc Document.characterSet trả về bảng mã ký tự của tài liệu hiện đang được kết xuất.
Note: "character set" (bộ ký tự) và "character encoding" (bảng mã ký tự) có liên quan nhưng khác nhau. Mặc dù tên của thuộc tính này, nó trả về encoding (bảng mã).
Giá trị
Một chuỗi.
Ví dụ
js
console.log(document.characterSet);
// document's character encoding, such as "ISO-8859-1" or "UTF-8"
Đặc tả kỹ thuật
| Specification |
|---|
| DOM> # ref-for-dom-document-characterset①> |