My Javascript is not working in localhost XAMPP
<p>I  hope someone can help my project school. I have a piece of HTML code like this:</p>

<pre><code>&lt;!DOCTYPE html&gt;
&lt;html&gt;
    &lt;head&gt;
        &lt;title&gt;Tambah Guru&lt;/title&gt;
        &lt;link rel="stylesheet" type="text/css" href="stylesheet.css"/&gt;
        &lt;script type='text/javascript' src='script.js' charset="utf-8"&gt;&lt;/script&gt;
    &lt;/head&gt;
&lt;body&gt;

Email: &lt;input type='text' id='txtemail' /&gt;

&lt;input type='submit' value='Simpan' id='validateemail' /&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>And then my Javascript code is:</p>

<pre><code>$(document).ready(function(e) {
    $('#validateemail').click(function() {
        var sEmail = $('#txtemail').val();
        if ($.trim(sEmail).length == 0) {
            alert('Please enter valid email address');
            e.preventDefault();
        }
        if (validateEmail(sEmail)) {
            alert('Email is valid');
        } else {
            alert('Invalid Email Address');
            e.preventDefault();
        }
    });
});

function validateEmail(sEmail) {
    var filter = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
    if (filter.test(sEmail)) {
        return true;
    } else {
        return false;
    }
}
</code></pre>

<p>when I run it, it does not work. I don't know why. Can anybody help me please?</p>
