How to include javascript in html5

I can not connect an external JavaScript file to my html page.
When I put the script in the page with the tag it all works
but when I insert it in an external file is not working, what is wrong?

<!DOCTYPE!>
<head>
<link href='http://fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'>
<!-- JQuery da Google -->
<script language="javascript" type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<!---------------------->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Document</title>
<!-- CSS -->
<link href="style.css" rel="stylesheet" type="text/css" />
<!-- JS-->
<script src="js/function.js" type="text/javascript"></script>
</head>

<body>

<footer>
<img class="info" src="img/newsletter.png" width="32" height="32" alt="info" />
</footer>

<div id="info">
    <ul class="infomenu">
        <li class="newsletter">NEWSLETTER</li>
        <li>PRIVACY</li>
        <li>CONTACT</li>
        <li>FOLLOW US</li>
    </ul>

</div>
</body>
</html>

Javascript

    //Jquery Info
$(document).ready(function(){
    $(".info").hover(function(){
        $("#info").fadeIn("slow");
    });

    $(".close").click(function(){
        $("#info").fadeOut("slow");
    });

});


Source: javascript

Leave a Reply