Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6582719
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:18:58+00:00 2026-05-25T16:18:58+00:00

I have a (Javascript) tool which dynamically creates a div whenever the user clicks

  • 0

I have a (Javascript) tool which dynamically creates a div whenever the user clicks on the screen.

_newDiv = document.createElement('div');

Now, after I’ve created _newDiv, I want to assign a onmousedown event to it.

_newDiv.onmousedown = function(event) { onNewDivMouseDown(event); };

This works perfectly in Firefox, but doesn’t work in IE 8. Is there any hack I can use to solve this problem?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T16:18:59+00:00Added an answer on May 25, 2026 at 4:18 pm

    Problem solved!

    It turns out that due to the fact that the dynamically created div was made transparent using progid:DXImageTransform, IE didn’t capture the onmousedown event for said div. The problem was solved by inserting

    background-image:url(/none)
    

    in the div’s stylesheet. For some reason it works even if a non-existing image is inserted, so I used that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have JavaScript that is doing activity periodically. When the user is not looking
I have JavaScript code which copies the value of input file and paste it
I'm looking for a tool with which I can annotate source code. I have
I have a website in which I provide tool-tips for certain things using a
I have recently converted 10 JavaScript files into one file, which I then run
I have been experimenting with woopra.com A web analytics tool. Which requires a piece
I have some JavaScript code which I want to make more readable. However, due
I have a question regarding JavaScript and methods by which its code can be
I have always thought of JavaScript as a client-side scripting tool for augmenting the
I have a tool, similar in ways to JSFiddle, that allows me to dynamically

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.