Main Page
 The gatekeeper of reality is
 quantified imagination.

Stay notified when site changes by adding your email address:

Your Email:

Bookmark and Share
Email Notification
Removing HTML Elements [Go Back]
You can remove an HTML element that is present within the webpage. This is accomplished by using the removeChild() function. In the code below, dropElement(target) takes the ID of the element you wish to remove and then removes it. The span element simply functions as a means to call the javascript function.

<script language="javascript">
<!--
function dropElement(target) {
document.body.removeChild(document.getElementById(target));
}
//-->
</script>

HTML Code:
<span onmousedown="dropElement('tmpRubricTxtInput');">CLICK TO MAKE INPUT BOX DISAPPEAR</span>
<br /><br /><input type="text" id="tmpRubricTxtInput" size="10" value="Bye, bye box" />


TRY THE DEMO:
CLICK TO MAKE INPUT BOX DISAPPEAR

About Joe