function verifyCaptcha() {
var userInput = document.getElementById('captchaInput').value;
var correctCaptcha = "1234"; // 假设正确的验证码是1234
var messageDiv = document.getElementById('message');
if (userInput === correctCaptcha) {
messageDiv.innerHTML = "验证码正确,正在跳转...";
// 模拟跳转到一个新的页面,实际应用中可以使用window.location.href = 'next-page.html';
setTimeout(function() {
window.location.href = 'next-page.html'; // 替换为你的目标页面URL
}, 2000); // 2秒后跳转
} else {
messageDiv.innerHTML = "验证码错误,请重试。";
messageDiv.style.color = "red"; // 设置错误信息颜色为红色
}
}