HTMLInputElement: alpha property

Limited availability

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.

Value

A boolean value.

Examples

html
<input id="color-picker" type="color" alpha />
js
const colorInput = document.getElementById("color-picker");

if (colorInput.alpha) {
  // Color values contain an alpha component
} else {
  // We have fully opaque color values
}

Specifications

Specification
HTML
# dom-input-alpha

Browser compatibility

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
Experimental
Chrome – No support
Chrome
footnote
footnote See bug 368059226
Edge – No support
Edge
footnote
footnote See bug 368059226
Firefox – No support
Firefox
footnote
footnote See bug 1919718
Opera – No support
Opera
footnote
footnote See bug 368059226
Safari – Full support
Safari 18.4 (Release date: 2025-03-31)
footnote Full support
Chrome Android – No support
Chrome Android
footnote
footnote See bug 368059226
Firefox for Android – No support
Firefox for Android
footnote
footnote See bug 1919718
Opera Android – No support
Opera Android
footnote
footnote See bug 368059226
Safari on iOS – Full support
Safari on iOS 18.4 (Release date: 2025-03-31)
footnote Full support
Samsung Internet – No support
Samsung Internet
footnote
footnote See bug 368059226
WebView Android – No support
WebView Android
footnote
footnote See bug 368059226
WebView on iOS – Full support
WebView on iOS 18.4 (Release date: 2025-03-31)
footnote Full support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
Experimental. Expect behavior to change in the future.
See implementation notes.

See also