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 8411939
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:33:07+00:00 2026-06-10T00:33:07+00:00

I tried drag and drop in HTML. It is working good in all browsers

  • 0

I tried drag and drop in HTML. It is working good in all browsers except IE9 (no need to work on lower than IE9). ondrop event is not triggered in IE9.

any help? here is my code.

jsFiddle

Thanks in advance.

  • 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-06-10T00:33:09+00:00Added an answer on June 10, 2026 at 12:33 am

    It’ll work if you replace div with a tags. However there are a couple of other changes you ought to make, firstly make sure that the a tags aren’t clickable links by returning false in the onclick event:

    <a class="div123" href="#" draggable="true"
     ondragstart="handleDragStart(event)"
     ondrop="handleDrop(event)"
     ondragover="dragoveHandler(event)"
     onclick="return false;">
        HTML5 drag and drop
    </a>
    

    Secondly, IE9 doesn’t accept parameters of text/plain in setData, use Text instead or add the data inside of a try...catch. Also, you should make sure the data you’re adding is actually text:

    e.dataTransfer.setData("Text", "" + $(e.target).index());
    

    Finally your handleDrop function needs to preventDefault/return false because otherwise the default action for dropping a link (an a element`) is to navigate to the dropped URL:

    function handleDrop(e) {
        alert($(e.target).index());
        if (e.preventDefault) {
            e.preventDefault(); // Necessary. Stops redirect.
        }
        return false;
    }
    

    Here is a jsFiddle of your code which will work in IE9.

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

Sidebar

Related Questions

I tried to get Drag and Drop working between two ListBox Controls. But somehow
I tried to work with html5 drag&drop api, and it works very well on
I'm working with the jQuery Sortable plugin to drag and drop images from one
I have tried using drag n drop to place the control as well as
I am working with an application that uses drag and drop operations of grids.
How do I diable the drag-drop of an image. I've tried to stopPropagation, but
After looking all around the internet without finding out how to implement Drag Drop
The best drag and drop GUI builder for wxPython? I've tried wxGlade but its
Tried a bunch of things but I can't get it to work consistently amid
I am wondering how those drag and drop widgets cancel text selection in the

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.