HTMLIFrameElement: thuộc tính width

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 width của giao diện HTMLIFrameElement trả về một chuỗi phản ánh thuộc tính width của phần tử <iframe>, cho biết chiều rộng của khung theo pixel CSS.

Giá trị

Một chuỗi cho biết chiều rộng của khung theo pixel CSS.

Ví dụ

html
<iframe id="el" width="800" height="600"></iframe>
js
const el = document.getElementById("el");
console.log(el.width); // Output: '800'

Đặc tả kỹ thuật

Specification
HTML
# dom-dim-width

Tương thích trình duyệt

Xem thêm