Skip to content

Commit

Permalink
Implement empty()
Browse files Browse the repository at this point in the history
  • Loading branch information
Jannik Zschiesche committed Jul 5, 2017
1 parent 643ba4a commit d5ed433
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions dom/manipulate.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,20 @@ export function remove (element)
}
}

/**
* Empties the given element(s)
* @param {HTMLElement|HTMLElement[]} element
*/
export function empty (element)
{
const list = Array.isArray(element) ? element : [element];

for (let i = 0; i < list.length; i++)
{
list[i].innerHTML = "";
}
}


/**
* Replaces the given element with the replacement element
Expand Down

0 comments on commit d5ed433

Please sign in to comment.