diff --git a/index.html b/index.html index f4382fb..b8c3fbf 100644 --- a/index.html +++ b/index.html @@ -550,6 +550,12 @@ fillCharacterRoster(); }; + const clearContainer = (cont) => { + while (cont.firstChild) { + cont.removeChild(cont.lastChild); + } + }; + const fillCharacterRoster = () => { var characterIDs = Object.keys(characterRoster).toSorted((idA, idB) => { // Sort by campaign name first @@ -566,9 +572,7 @@ var placeHolder = inpCharacterRoster.options[0]; - while (inpCharacterRoster.firstChild) { - inpCharacterRoster.removeChild(inpCharacterRoster.lastChild); - } + clearContainer(inpCharacterRoster); inpCharacterRoster.appendChild(placeHolder);