-2
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
<script type="text/javascript" src="date_time.js"></script>
</head>
<body>
<input id="input"><br>What is the number?</input>
<button type="button" onclick="getFunction()">Submit</button>
<script>
function getFunction() {
var x = document.getElementById('input').value;
if (x == 32) {
window.alert("Right answer!");
}
else {
window.alert("Try again.");
}
}
</script>
</body>
</html>
所以我想繼續或加載一個新的HTML頁面,當用戶點擊「提交」按鈕,輸入是正確的。有任何想法嗎?也許JS DOM可以幫助...當輸入正確的onload html文件
謝謝,它的工作! – jbuchel