Syntax:
Oelement = object.Insertadjacentelement(Swhere, oelement)
Parameters:
Oelement: required. Object (element ). The object to insert to the adjacent object.
Swhere: required. String ). Beforebegin | afterbegin | beforeend | afterend beforebegin: inserts an oelement before the start tag of the object.
Afterbegin: inserts an oelement after the start tag of the object. But before all the original content of the object.
Beforeend: insert the oelement before the end tag of the object. But after all the original content of the object.
Afterend: insert the oelement to the end tag of the object.
Return Value:
Oelement: Object (element ). Returns the reference of the inserted object.
Note:
Insert the oelement into the document structure based on the object positioning.
You cannot try this method when the document is being loaded. It must be after the onload event is triggered.
If you try to insert an object that has already been located in the document structure, the object will be moved to the position you specified, and no new object will be created.
- list project 1
- list project 2
button B |
beforebegin afterbegin beforeend afterend |
|