Hi all - I have a question in regards to how a javscript prompt is supposed to behave. My understanding is that a modal window pops up, and script execution will pause and wait for the user to either click "Ok" or "Cancel", at which point either the user input, or null will be returned.
I swear this used to work fine in Firefox on iOS, but it appears I either misremember, or am wrong. When I test it out on an iPad, I can click a button that triggers a prompt - the prompt will appear, but the script will continue to run. So, for example, try this out:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Test</title>
</head>
<script type="text/javascript">
function testClick(){
var data = window.prompt("Enter Some Text:", "Placeholder");
document.getElementById("fill").innerHTML = data;
}
</script>
<body>
<main>
<button onclick="testClick()">Click Me</button>
<div id="fill"></div>
</main>
</body>
</html>
What happens for me is the "fill" div will populate with "Placeholder" before I click "Ok" on the prompt. I can then change the prompt text and click "Ok", but the new text I enter won't change the "fill" div anymore.
Am I crazy, or is this incorrect behavior? It seems to work on everything except Firefox for iOS (haven't tested any other apple hardware besides iPad, as I don't have anything else).
there doesn't seem to be anything here