<form>
<input type=text name=textField size=45>
<input type="button" value="Ответ">
</form>
<script>
window.onload = function () {
document.forms[0].children[1].onclick = function () {
var text = document.forms[0].textField.value;
if (text == 'ha') {
location.href = 'http://javascript.ru';
} else {
alert('ответ неверный');
}
}
}
</script>