ParentNode of New Elements
November 19th, 2008 | JavaScript | No Comments »I wrote a simple script to pop-up a modal-like element when clicking on an “Add” button on the page. I wanted to insert the element into the DOM on first click, and on subsequent clicks, simply reset the form. A bug popped up in IE7 (surprise) that prevented me from checking if I had inserted the element already.


Javascript lets us run program logic on the client-side, meaning we can change HTML Elements dynamically based on some logic without reloading the page with a new server call. This logic is run by Events that are launched from User Interaction. A common way of doing so is adding inline Javascript events, but I’d like to erradicate this scourge from the web.
