nmyster
nmyster

Reputation: 452

Removing a class from parent element

I am trying to figure out how to remove a class from a parent element when the element has begun dragging.

Meaning I have <div> elements in a table cell and I want to remove the class "contains_piece" from the table cell once the <div> has started being dragged.

I'm using jQuery to add the class to the cell that the div has been dropped on but cannot figure out how to work out this problem.

Upvotes: 0

Views: 81

Answers (2)

J. K.
J. K.

Reputation: 8368

$(element).parent().removeClass('something');

Like this?

Upvotes: 2

xdazz
xdazz

Reputation: 160933

Shouldn't be .parent().removeClass('contains_piece'); ?

Upvotes: 1

Related Questions