:optional

Read More at MDN DocsView Spec

Safe to Use

:optional is considered safe to use.

It’s supported by 94% of global browsers.

Browsers

ChromeMar 8, 2011v10.0.0
26%100%
100% of Chrome users are running a supported version.
SafariJun 7, 2010v5.0.0
5%100%
100% of Safari users are running a supported version.
EdgeJul 28, 2015v12.0.0
5%100%
100% of Edge users are running a supported version.
FirefoxMar 22, 2011v4.0.0
3%100%
100% of Firefox users are running a supported version.

Version Breakdown

 
Agent
Support
Adoption
Chrome
Mar 8, 2011 v10.0.0
26%100%
100% of Chrome users are running a supported version.
Mar 8, 2011 – Latest
v10.0.0+
26%100%

Full Support

Chrome Android
Jun 27, 2012 v18.0.0
36%100%
100% of Chrome Android users are running a supported version.
Jun 27, 2012 – Latest
v18.0.0+
36%100%

Full Support

Edge
Jul 28, 2015 v12.0.0
5%100%
100% of Edge users are running a supported version.
Jul 28, 2015 – Latest
v12.0.0+
5%100%

Full Support

Firefox
Mar 22, 2011 v4.0.0
3%100%
100% of Firefox users are running a supported version.
Mar 22, 2011 – Latest
v4.0.0+
3%100%

Full Support

Firefox for Android
Mar 29, 2011 v4.0.0
Firefox for Android supports this feature.
Mar 29, 2011 – Latest
v4.0.0+

Full Support

Internet Explorer
Oct 26, 2012 v10.0.0
0%83%
There are no users of Internet Explorer running a supported version.
Oct 26, 2012 – Latest
v10.0.0+
0%83%

Full Support

 
Quest Browser
Unknown v5.0.0
Quest Browser supports this feature.
Unknown
v5.0.0+

Full Support

Opera
Sep 1, 2009 v10.0.0
1%100%
100% of Opera users are running a supported version.
Sep 1, 2009 – Latest
v10.0.0+
1%100%

Full Support

Opera Android
Nov 9, 2010 v10.1.0
Opera Android supports this feature.
Nov 9, 2010 – Latest
v10.1.0+

Full Support

Safari
Jun 7, 2010 v5.0.0
5%100%
100% of Safari users are running a supported version.
Jun 7, 2010 – Latest
v5.0.0+
5%100%

Full Support

Safari on iOS
Oct 12, 2011 v5.0.0
17%100%
There are no users of Safari on iOS running a supported version.
Oct 12, 2011 – Latest
v5.0.0+
17%100%

Full Support

Samsung Internet
Apr 27, 2013 v1.0.0
2%100%
100% of Samsung Internet users are running a supported version.
Apr 27, 2013 – Latest
v1.0.0+
2%100%

Full Support

WebView Android
Sep 3, 2014 v37.0.0
WebView Android supports this feature.
Sep 3, 2014 – Latest
v37.0.0+

Full Support

See Also

Contribute