12.5 Drag and Drop with the “draggable” Attribute 283
When dragging elements with microdata attributes, all values are automatically
taken along as a JSON character string. You can access them easily via
getData('application/microdata+json').
If we decide to remove certain formats from the list during the drag-and-drop
operation, we can use the method clearData(format) to delete the specified for-
mat. If we omit format altogether, all existing formats are deleted.
The two DataTransfer attributes effectAllow and dropEffect sound promising,
hinting at appealing optical effects during dragging and dropping. On closer
inspection it becomes clear that they only serve to control the appearance of
the cursor while entering the drop zone. Permitted keywords for dropEffect are
copy, link, move, and none. They add a plus symbol, link symbol, arrow, or noth-
ing (if none is selected) to the cursor during the dragenter event. With a small
application (see Figure 12.3), you can test the behavior of your browser online at
http://html5.komplett.cc/code/chap_global/dropEffect_en.html.
TIP
Figure 12.3 Test application of the “dataTransfer.dropEffect”
The value of the dropEffect attribute can be changed in any phase of the drag-
and-drop action, but it must always correspond to the value specified previ-
ously in effectAllow. In addition to copy, link, move, and none, effectAllow also