Function Description
Takes three parameters. It replaces old dom element with the new dom element of the element or UPJSObject.
Function prototype
_.replace(element,newNode,oldNode). Replaces @oldNode with @newNode of the @element. Replaces @oldNode with @newNode of the UPJSObject.
Function parameters
@element - dom element
@newNode - dom element, node
@oldNode - dom element, node of @element
Sample HTML DIV element is given to try UPJS function.
Orange DIV
Apple DIV
  • apple 1
  • apple 2
Code area to try out replace,_.replace function.