Julia Julia - 26 days ago 5
CSS Question

I am not able to connect javascript with html

This is my html code

<!DOCTYPE HTML>
<html>
<head>
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.0.js"></script>
<script src='Newproject\Success.js'></script>


and this is my JavaSkript code

$(document).ready(function(){
$('div').hover(function(){
$(this).addClass('hover')
},
function(){
$(this).removeClass('hover')
)};
)};


javaskript is in the same file html is, the folder is called Newproject

I can't connect them, .js does not work,please, help me

Answer

Change )} to }):

$(document).ready(function(){
    $('div').hover(
        function(){
            $(this).addClass('hover')
        },
        function(){
            $(this).removeClass('hover')
        }
    ) // it is }) indeed
});