HTMLInputElement: thuộc tính alpha
Khả dụng hạn chế
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
Thuộc tính alpha của giao diện HTMLInputElement phản ánh thuộc tính alpha của phần tử <input>, cho biết liệu thành phần alpha của màu CSS có thể được người dùng cuối thao tác và không nhất thiết phải hoàn toàn trong suốt. Nó chỉ liên quan đến các điều khiển color.
Giá trị
Một giá trị logic.
Ví dụ
html
<input id="color-picker" type="color" alpha />
js
const colorInput = document.getElementById("color-picker");
if (colorInput.alpha) {
// Giá trị màu chứa thành phần alpha
} else {
// Chúng ta có giá trị màu hoàn toàn trong suốt
}
Đặc tả kỹ thuật
| Thông số kỹ thuật |
|---|
| HTML> # dom-input-alpha> |