Home | Top | Free Ajax Editor | JavaScript Editor | Get Advanced JavaScript and Ajax Editor, Validator and Debugger! 1st JavaScript Editor. |
Inserts an element at the specified location.
Syntax
oElement = object .insertAdjacentElement( sWhere , oElement )Parameters
sWhere | Required. String that specifies where to insert the HTML element, using one of the following values:
|
||||||||
oElement | Required. Object that specifies the element to be inserted adjacent to the object that invoked the insertAdjacentElement method. |
Return Value
Returns an element object.
Remarks
You cannot insert text while the document is loading. Wait for the onload event before attempting to call this method.
If you try to insert an object that already exists on the page, the existing object will be moved to the point that you specified in the insertAdjacentElement method; no new object will be created.
Example
This example uses the insertAdjacentElement method to add a new list item to an ol object.
<SCRIPT>
Standards Information
There is no public standard that applies to this method.
Applies To
|
A , ACRONYM , ADDRESS , APPLET , AREA , B , BASE , BASEFONT , BDO , BGSOUND , BIG , BLOCKQUOTE , BODY , BR , BUTTON , CAPTION , CENTER , CITE , CODE , COL , COLGROUP , COMMENT , DD , DEL , DFN , DIR , DIV , DL , DT , EM , EMBED , FIELDSET , FONT , FORM , FRAME , FRAMESET , HEAD , hn , HR , HTML , I , IFRAME , IMG , INPUT type=button , INPUT type=checkbox , INPUT type=file , INPUT type=hidden , INPUT type=image , INPUT type=password , INPUT type=radio , INPUT type=reset , INPUT type=submit , INPUT type=text , INS , KBD , LABEL , LEGEND , LI , LINK , LISTING , MAP , MARQUEE , MENU , nextID , OBJECT , OL , OPTION , P , PLAINTEXT , PRE , Q , S , SAMP , SCRIPT , SELECT , SMALL , SPAN , STRIKE , STRONG , SUB , SUP , TABLE , TBODY , TD , TEXTAREA , TFOOT , TH , THEAD , TITLE , TR , TT , U , UL , VAR , XMP |
Home | Top | Free Ajax Editor | JavaScript Editor | Get Advanced JavaScript and Ajax Editor, Validator and Debugger! 1st JavaScript Editor. |