rgrove / jquery-yui3-rosetta-stone

A guide to idioms in YUI 3 and jQuery.
BSD 3-Clause "New" or "Revised" License
65 stars 20 forks source link

.remove() #16

Closed caseybessette closed 12 years ago

caseybessette commented 12 years ago

Add examples on how to remove elements from DOM?

rgrove commented 12 years ago

In YUI:

Y.one('#foo').remove();     // Removes #foo from its parent.
Y.one('#foo').remove(true); // Removes #foo and purges plugins and events.

Anyone want to contribute the equivalent jQuery code?

caseybessette commented 12 years ago

jQuery:

$('#foo').remove();      // Removes #foo including events and jQuery data.
$('div').remove('#foo'); // Removes #foo from within DIV element.