removeObjectByID

This function will remove the object from the page. Note this function will remove the element rather than hide it. Any further scripts or calls to the targeted div will cause an error since it no longer exists.

Try this function

This is targetDiv1
This is targetDiv2

Requirements

Insert the following into the <head> element.

Syntax

This function is called with the following line: removeObjectByID(myID);

Arguments

Implementation Steps

  1. Make sure correct .js files (listed above) are imported in the <head> element.
  2. Give the target element an id
  3. Insert correct function call such as onmousedown="javascript:removeObjectByID(myID);"
  4. Change myID to the id you gave to target element, in single quotes.

The Code

	function removeObjectByID(myID)
	{
		removeObject(document.getElementById(myID));
	}