insertBefore

inserts a new node into the specified position

void insertBefore(HTMLElement node,HTMLElement before, [HTMLElement rescue] );
node
HTMLElementa new DOM node before
HTMLElementthe sibling node that the new node will be inserted before rescue
HTMLElementthe parent node used if the subling doesn't exist

Example

var newdiv=document.createElement("div");
webix.html.insertBefore(newdiv,document.getElementById("myDiv"))

Details

The method inserts a new node before the specified sibling (the before parameter) or as the last child of the specified parent (the rescue parameter) if the sibling doesn't exist.
The third parameter is optional and used just to avoid errors in case the specified subling doesn't exist.

See also
  • API
  • Back to top
    Join Our Forum
    We've retired comments here. Visit our forum for faster technical support, connect with other developers, and share your feedback there.