How to prevent jQuery UI change HTML elements with `draggable` attribute?

- 1 answer

Ad

Example: http://codepen.io/anon/pen/wMGbYv. As you can see, jQuery UI discards draggable attribute and adds it's own classes. How to prevent this naughtiness and create element with draggable attribute without discarding jQuery UI (preferably using jQuery)?

Ad

Answer

Ad

Use

$( '<div/>' ).prop( 'draggable', true )

Instead of $( '<div/>', { draggable: true } ). Example: http://codepen.io/anon/pen/adNrPq.

Ad
source: stackoverflow.com
Ad