Hi all,

I have just started working on Prototpye JS. I must say it runs likea charm. but whenever i tried to Use Event object to observe key press event it gives js error. Actually i want to find out whether the click is done over the selected div or not.. if not then i want to hide it.

Plz help me out..

My js code inside the Script tag is as follow. (This is just to check for TAB keypress observation)

Code:
Event.observe(document, 'keypress', function(event)
{
    if(Event.keyCode(event) == Event.KEY_TAB)
        alert('Tab Pressed');
});
Plz help me out