хотя проще
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<script>
function check() {
alert((document.getElementById('text').value == "Mark") ? 'You can go' : 'You shell not past');
}
</script>
</head>
<body>
<p>Введите ваше имя<input id="text"> <input type="button" value="click me" onclick="check()"></p>
</body>
</html>