PreferenceObject: validValues property

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

The validValues read-only property of the PreferenceObject interface returns a read-only array of values that are accepted by the override.

validValues

An array containing the valid values to override the PreferenceObject value with.

Examples

>

Basic usage

This example demonstrates how to log all possible contrast values.

js
console.log(navigator.preferences.contrast.validValues);

Specifications

Specification
Media Queries Level 5>
# valid-values-attribute>

Browser compatibility