Javascript – JQuery hide div – resulting in javascript error

javascriptjqueryjquery-ui

I have the following html in page:

<head>
<script src="jquery-1.3.2.min.js" type="text/javascript"></script>    
<script>
        function hideIt() {
            $(this).hide("slow");
            return true;
        }         
    </script>
</head>
<body>
<div onclick="hideIt();">
         hello world
    </div>
</body>

When I click on the div, it results in the following JavaScript error:

Line: 53
Error: 'this[…].style' is null or not an object

Any solutions?

Best Solution

This should fix it

<div onclick="hideIt(this);">

and

function hideIt(o) {
            $(o).hide("slow");
            return true;
        }