Hello...I am new to java and have written some code...and now I am getting a 'SyntaxError: Parse error'. My code is :

if (window.innerWidth && window.innerWidth <= 480) { 
    $(document).ready(function(){ 
        $('#header ul').addClass('hide'); 
        $('#header').append('<div class="leftButton" 
            onclick="toggleMenu()">Menu</div>'); 
    });
    function toggleMenu() { 
        $('#header ul').toggleClass('hide'); 
        $('#header .leftButton').toggleClass('pressed'); 
    }
}

Any help is greatly appreciated.

My first guess would be because that code is JQuery and this is the Java forum, whereas JQuery is written in Javascript.