coderef

showPicker() for <input>Limited availability

The showPicker() method for &#x3C;input> elements shows the user interface for picking a value. For example, for &#x3C;input type="date"> it shows the interface for picking a date.

Not yet supported in all major browsers — check the table and provide a fallback.

Browser support

DesktopChrome
1–98Not supported
99+Supportedsince Mar 1, 2022
Current: 155
Edge
12–98Not supported
99+Supportedsince Mar 3, 2022
Current: 154
Firefox
1–100Not supported
101+Supportedsince May 31, 2022
Current: 157
Safari
1–17.3Not supported
17.4+Supportedsince Mar 5, 2024
Current: 27
MobileChrome Android
18–98Not supported
99+Supportedsince Mar 1, 2022
Current: 155
Firefox Android
4–100Not supported
101+Supportedsince May 31, 2022
Current: 157
Safari iOS
✕Not supportedup to 27
Current: 27

How to use

Not supported in Safari iOS. Use feature detection below and provide a fallback (or a polyfill) for those browsers.

Example

Full syntax and examples are on MDN: showPicker.

Feature detection

JS · check before using
if ("HTMLInputElement" in globalThis && "showPicker" in HTMLInputElement.prototype) {
  // HTMLInputElement.showPicker is available
}

Sub-features

Support for each part of the feature (5). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
HTMLInputElement.showPicker9999101169910116
HTMLInputElement.showPicker.color_input99991011699101✕
HTMLInputElement.showPicker.date_input999910117.499101✕
HTMLInputElement.showPicker.datetime_local_input999910117.499101✕
HTMLInputElement.showPicker.file_input9999101169910116