sw45acp Posted April 5, 2010 Share Posted April 5, 2010 Hi, I have the following javascript: function createDiv() { var newDiv = document.createElement("div"); newDiv.setAttribute("id","box"); document.body.appendChild(newDiv); var box = document.getElementById("box"); } and html: <input type="button" value="Create Div" onclick="createDiv()" /> that creates a new div on the page. What I would like is for this div to completely disappear when a user clicks anywhere else on the page. What I mean can generally be seen on any javascript date picker/calendar for forms. Any help is appreciated, thank you. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.