ElementReplacer
class
Utility class allowing to hide existing HTML elements or replace them with given ones in a way that doesn't remove the original elements from the DOM.
Properties
_replacedElements : Array<object>privatemodule:utils/elementreplacer~ElementReplacer#_replacedElementsThe elements replaced by
replaceand their replacements.
Methods
module:utils/elementreplacer~ElementReplacer#constructorreplace( element, [ newElement ] ) → voidmodule:utils/elementreplacer~ElementReplacer#replaceHides the
elementand, if specified, inserts the the given element next to it.The effect of this method can be reverted by
restore.Parameters
element : HTMLElementThe element to replace.
[ newElement ] : HTMLElementThe replacement element. If not passed, then the
elementwill just be hidden.
Returns
void
restore() → voidmodule:utils/elementreplacer~ElementReplacer#restore