Hi i have a Div and underneath that there is another div. By default the second div is not visible. Now on mouse over of the first div i am displaying the second div and also on mouse out i am hiding the second div. But the problem is on mouse over i display the second div and when i try to move the mouse on to the second div the second div gets disappeared. I am trying to do menu and sub menu. I need the second div to be displayed when i directly drag the mouse from first div to second div. how can i achieve this?

Put the second div inside the first div, then the mouse never leaves div 1 and the mouse out event never fires.

Menu and Submenu are better implemented using unordered lists as menu and a list inside it as submenu. So u would not have this problem and the semantics will be right as well.

That is actually a very good point. +1