treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Problem with cloning a element using jquery ui

  • Guys, I really don´t know what I´m doing wrong in this code. I´m playing around with drag and drop and I´m trying to clone a element but the element doesn´t clone. Here´s the code:

      $(document).ready(function(){
        $('#draggable').draggable({
          helper: 'clone'
        });
      });
    

    I only got one div.

  • Check out this demo.

    I used mydraggable as the class name of the div so that the clone would have the same styling.

    Make sure that jQuery, jQuery UI and jQuery UI css is loaded.