How to get Dragable or Dropable element ID or attribute value in J-Query.

Some time we need to know in J-query Drag and drop functionality what are the element has dropped and There ID , and another attribute value let say get dropped element width value , height value for this you have do something like below.

    $(".dropableRow").droppable({
        drop: function (ev, ui) {

            //to get the id
            //ui.draggable.attr('id') or ui.draggable.get(0).id or ui.draggable[0].id
            var draggableId = ui.draggable.attr("id");
            var droppableId = $(this).attr("id");

            // Alert dragable elment id and dropable element Id
            alert("dragable Element Id" + draggableId + " dropableId  " + droppableId);
        }
    });

Page Keyword: Get Dragable Property value in jquery, How to get Dragable element id in jquery, How to get dragable element class name in jquery, How to know dropable ID in jquery, Get dropped element attribute in jquery.

Advertisements

One thought on “How to get Dragable or Dropable element ID or attribute value in J-Query.

  1. Pingback: How to Parse JSON Date on client side by java script. | [Code Destination]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s