O'Reilly logo

HTML5: Your visual blueprint™ for designing rich web pages and applications by Adam McDaniel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

SPECIFY A DROP ZONE

In order to support drag and drop in HTML5, you will require at least one element to accept draggable elements. Although there is a dropzone attribute that you could use, as described in the section “Introducing Drag and Drop in HTML5,” it is not currently supported by any HTML5 web browsers. Instead, you can assign a dropzone CSS class to one or more elements and then use jQuery to add the event listeners, as shown in the preceding section, “Specify Objects to Drag”:

<element class='dropzone'>...</element>

Note that you do not actually need a CSS rule with the name dropzone in order to use it as a CSS class. Because jQuery’s selector will match all elements that identify themselves with the dropzone class, this is more ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required