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 anexperimental technology
Check theBrowser compatibility table carefully before using this in production.
Thealpha property of theHTMLInputElement interface reflects the<input> element'salpha 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 tocolor controls.
In this article
Value
A boolean value.
Examples
html
<input 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> |