Getting the id of child element based on the parents class name
Posted
by sea_1987
on Stack Overflow
See other posts from Stack Overflow
or by sea_1987
Published on 2010-04-14T10:09:57Z
Indexed on
2010/04/14
10:13 UTC
Read the original article
Hit count: 223
I am currently playing around with jqueries drag and drop, basically I currently have a div (.drag_check) that holds a checkbox, I have the drag and drop working but I want to alert out the checkbox's ID once the element is dropped, I assume I have to use child but all my attempts have returned 'undefined'. Below is my code,
$('.drag_check').draggable({
containment: 'document',
opacity:0.6,
revert: 'invalid',
helper: 'clone',
zIndex: 100
});
$("ul.searchPage").droppable({
drop:
function(e, ui) {
var param = $(ui.draggable).attr('class')
addlist(param)
alert(param)
}
})
© Stack Overflow or respective owner