Posted on 2002-04-24
Last Modified: 2007-11-27
If I use setCapture() on an object, any mouse event that subsequently occurs applies to that object.

Therefore, in the following test code, I have set setCapture() on the menus object at load time.

Therefore, when I click on the document anywhere outside of the menus object, it should disappear.

Why is it not doing this?... Here is my test code, thanks,



function init()

function click_me()
     menus.innerHTML = ""


<DIV id="menus" onclick="click_me()" style="background-color:green; top:30; left:30"><span>Teddy</span></DIV>

</BODY onload="init()">

Question by:sorty
LVL 33

Accepted Solution

knightEknight earned 50 total points
ID: 6965917
Can you set the onLoad handler in the /body tag?

try this:

   <BODY onload="init()">

instead of this:

   </BODY onload="init()">

Author Comment

ID: 6966088
eureka! thanks,
I was staring at it for ages.. just needed the third eye.

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
ASP.NET gridview select textbox on focus 2 37
key press alert 2 19
Diminish Pop-up  in 3 seconds 7 21
Create an automated page index 9 16
Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
In my daily work (mainly using, I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question