JQuery - Why do I get "target is not defined"
<pre><code>$(document).ready(function() 
{ 
    $(".menubutton").click(function()
        { 
        var $id=$(event.target.id.substring(0,2));
        $(".active").animate({"top": "-=1000px"}, speedanim);
        $("div#homedrawer div").filter($(".active")).removeClass("active");
        $("#"+$id).animate({"top": "+=1000px"}, speedanim);
        $("#"+$id).addClass("active");
        return false; 
        });

});
</code></pre>

<p>The above code generates this error "target is not defined" referring to the line:</p>

<pre><code>var $id=$(event.target.id.substring(0,2));
</code></pre>

<p>this is the HTML:</p>

<pre><code>&lt;a id="fesbtn" class="menubutton" href="#"&gt;&lt;img src="img/menu/fes.png" alt="" /&gt;&lt;/a&gt;
&lt;a id="futbtn" class="menubutton" href="#"&gt;&lt;img src="img/menu/fut.png" alt="" /&gt;&lt;/a&gt;
&lt;a id="reibtn" class="menubutton" href="#"&gt;&lt;img src="img/menu/rei.png" alt="" /&gt;&lt;/a&gt;
...
</code></pre>

<p>obviously my syntax is wrong. Any thoughts? thank you</p>
