mirror of
https://github.com/servo/servo
synced 2026-05-01 03:47:53 +02:00
54 lines
1.5 KiB
HTML
54 lines
1.5 KiB
HTML
<html>
|
|
<!-- Padding to account for small screens of mobile devices -->
|
|
<style>
|
|
p {margin-top:48px;}
|
|
</style>
|
|
<head>
|
|
<title>Testing Alerts</title>
|
|
|
|
<script type="text/javascript">
|
|
function setInnerText(id, value) {
|
|
document.getElementById(id).innerHTML = '<p>' + value + '</p>';
|
|
}
|
|
|
|
function displayPrompt() {
|
|
setInnerText('text', prompt('Enter something'));
|
|
}
|
|
|
|
function displayPromptWithDefault() {
|
|
setInnerText('text', prompt('Enter something', 'This is a default value'));
|
|
}
|
|
|
|
function displayTwoPrompts() {
|
|
setInnerText('text1', prompt('First'));
|
|
setInnerText('text2', prompt('Second'));
|
|
}
|
|
|
|
function displayConfirm() {
|
|
setInnerText('text', confirm('cheese'));
|
|
}
|
|
</script>
|
|
</head>
|
|
<body>
|
|
|
|
<h1>Testing Alerts and Stuff</h1>
|
|
|
|
<p>This tests alerts: <a href="#" id="alert" onclick="alert('cheese');">click me</a></p>
|
|
|
|
<p>This tests alerts: <a href="#" id="empty-alert" onclick="alert('');">click me</a></p>
|
|
|
|
<p>Let's make the <a href="#" id="prompt" onclick="displayPrompt();">prompt happen</a></p>
|
|
|
|
<p>Let's make the <a href="#" id="prompt-with-default" onclick="displayPromptWithDefault();">prompt with default happen</a></p>
|
|
|
|
<p>Let's make TWO <a href="#" id="double-prompt" onclick="displayTwoPrompts();">prompts happen</a></p>
|
|
|
|
<p>This tests confirm: <a href="#" id="confirm" onclick="displayConfirm();">test confirm</a></p>
|
|
|
|
<div id="text"></div>
|
|
<div id="text1"></div>
|
|
<div id="text2"></div>
|
|
|
|
</body>
|
|
</html>
|