api.Window.prompt

Spec

MDN URL

Status

On the standards track: Yes

Is Experimental: No

Is Deprecated: No

Browser Support

In Chrome version 1 on 2008-12-11 Note: Starting with Chrome 46, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.

In Chrome Android version 18 on 2012-06-27 Note: Starting with Chrome Android 46, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.

In Deno version 1.5 on 2020-10-27

In Edge version 12 on 2015-07-29

In Firefox version 1 on 2004-11-09 Note: Firefox strips newline characters from the prompt response; see bug 1716229.

In Firefox for Android version 4 on 2011-03-29 Note: Firefox for Android strips newline characters from the prompt response; see bug 1716229.

In Internet Explorer version 4 on 1997-09-30 Note: This function has no effect in the Modern UI/Metro version of Internet Explorer for Windows 8. It does not display a prompt to the user, and always returns undefined. It is not clear whether this is a bug or intended behavior. Desktop versions of IE do implement this function.

In Quest Browser version 5.0 on undefined Note: Starting with Quest Browser 5.0, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.

In Opera version 3 on 1997-12-01 Note: Starting with Opera 33, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.

In Opera Android version 10.1 on 2010-11-09 Note: Starting with Opera 33, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.

In Safari version 1 on 2003-06-23

In Safari on iOS version 1 on 2007-06-29

In Samsung Internet version 1.0 on 2013-04-27 Note: Starting with Samsung Internet 5.0, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.

In WebView Android version 4.4 on 2013-12-09 Note: Starting with WebView Android 46, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.

In WebView on iOS version 1 on 2007-06-29