views:

48

answers:

1

Hello guys,

I am creating a simple application using jquery, in this application I can drag an element(DIV) along the document. I can place the DIV at any position in the document, If I place this DIV above another element how can I find out what is the ID of the element that is below the dragging object,

for example if I place the dragging DIV over an element I want to know the ID of the element below the dragging DIV

Thanks a log

+2  A: 

If you DIV has a specific ID or class you can use the next() function (documented here).

 $('#dragdiv').next()

Then you can directly work with that jquery element or use attr() to obtain it's attributes (ID, etc)

Jack
I think the OP wants to know the underlaying element **before** dropping.
jAndy
Jack