Need help to fix simple JQuery function. Below code expected to show an alert, but no output at anytime. I'm new to this stuff. So correct me if something went wrong.
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<script>
$('#check').click(function() {
if ( $('#city').val() == '' )
{
alert('Empty!!!');
}
else
{
alert('Contains: ' + $('#city').val() );
}
});
</script>
</head>
<body>
<h3>Registration form</h3>
<form name="form1" method="post" action="">
City: <input type="text" name="city" id="city"><br>
Last name: <input type="text" name="LastName" value="Mouse"><br>
Phone number: <input type="text" name="Last" value="Mouse"><br>
<button id="check">Check</button>
</form>