views:

149

answers:

1

Hi.

I'm trying to detect the HTML5 Drag And Drop support in javascript. Modernizr seems to not handle this test case.

Any idea ?

Regards

+4  A: 

You can do this:

if('draggable' in document.createElement('span')) {
  alert("Drag support detected");
}

You can see a quick demo test using the above check here.

Also, there's a nice feature detection (not browser detection, yay!) list that's fairly well maintained here in case you're looking for other HTML5 features as well.

Nick Craver
Thanks a lot.Regards, gre.
gre
@gre - If that resolves your issue, make sure to accept an answer by clicking the check mark on th left, same goes for future answers :) If you are still running into anything please comment so I can help further
Nick Craver