Jonathan Wood
Jonathan Wood

Reputation: 67195

Remove Element from Object Reference

I want to use jQuery's remove() function to remove an item from the DOM.

The problem is that remove() requires a selector and I already have a reference to the element I want to remove in an object.

Given an element reference, say tableRow, is there any way to remove that element?

Upvotes: 0

Views: 51

Answers (1)

renakre
renakre

Reputation: 8291

This should work:

tableRow.remove();

or

$(tableRow).remove();

Upvotes: 4

Related Questions