Back to Content

PreferenceObject: validValues property

files/en-us/web/api/preferenceobject/validvalues/index.md

latest595 B
Original Source

{{APIRef("User Preferences API")}}{{SeeCompatTable}}{{SecureContext_Header}}

The validValues read-only property of the {{domxref("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 {{domxref("PreferenceObject")}} value with.

Examples

Basic usage

This example demonstrates how to log all possible contrast values.

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

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}