Wednesday, 8 November 2017

The draggable and dropzone Attributes in HTML5

We can make a draggable HTML element by using the draggable attribute.

The syntax:

element.draggable[=value]

In the preceding Syntax the value can be true, false or auto. The true value indicates that the  element is draggable, the false value indicates that the element is not draggable  and the auto value specifies the default behavior of the element.

<body>
<p draggable="true"> You can drag this paragraph. </p>
<p draggable="false">You cannot drag this paragraph</p>
</body>

The HTML element may specify the dropzone attribute to drop the data. the attribute is specified by using any one of the following values.

  • copy:- Creates a copy of the draggable data from source location to a target location.
  • move
  • link

No comments:

Post a Comment