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.
The alpha property of the HTMLInputElement interface reflects the <input> element's alpha attribute, which indicates whether the CSS color's alpha component can be manipulated by the end user and does not have to be fully opaque. It is only relevant to color controls.
A boolean value.
<input id="color-picker" type="color" alpha />
const colorInput = document.getElementById("color-picker");
if (colorInput.alpha) {
// Color values contain an alpha component
} else {
// We have fully opaque color values
}
| Specification |
|---|
| HTML> # dom-input-alpha> |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
alpha |
No | No | No | No | 18.4 | No | No | No | 18.4 | No | No | 18.4 |
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/alpha