remove :: Element

remove(element) -> HTMLElement

 

Completely removes element from the document and returns it.

 

If you would rather just hide the element and keep it around for further use, try hide() instead.

 

Examples

 

// Before:

<ul>

  <li id="golden-delicious">Golden Delicious</li>

  <li id="mutsu">Mutsu</li>

  <li id="mcintosh">McIntosh</li>

  <li id="ida-red">Ida Red</li>

</ul>

 

$('mutsu').remove();

// -> HTMLElement (and removes li#mutsu)

 

// After:

<ul>

  <li id="golden-delicious">Golden Delicious</li>

  <li id="mcintosh">McIntosh</li>

  <li id="ida-red">Ida Red</li>

</ul>

 


Prototype API 1.5.0 - prototypejs.org