diff --git a/script.js b/script.js index 2529994..2e09d17 100644 --- a/script.js +++ b/script.js @@ -41,7 +41,7 @@ async function run() { } function clear_game() { - gameDataInput.innerHTML = ""; + gameDataInput.value = ""; } let new_game_button = document.getElementById("new"); @@ -96,9 +96,10 @@ async function run() { function addTiles() { let image = document.getElementById("preview").getAttribute("src"); - let gameData = document.getElementById("game-data").innerHTML; + let gameData = document.getElementById("game-data").value; let prefix = document.getElementById("prefix").value; - document.getElementById("output").innerHTML = add_tiles(gameData, image, prefix); + + output.value = add_tiles(gameData, image, prefix); } const importButton = document.getElementById("import"); @@ -116,7 +117,7 @@ async function run() { addImageButton.addEventListener("touchend", addImage); function reset() { - gameDataInput.innerHTML = ''; + clear_game(); preview.removeAttribute("src"); }