diff options
Diffstat (limited to 'rannak/mangud/perenaine/kuulamine/script.js')
-rw-r--r-- | rannak/mangud/perenaine/kuulamine/script.js | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/rannak/mangud/perenaine/kuulamine/script.js b/rannak/mangud/perenaine/kuulamine/script.js index 680c6fd..72b8e70 100644 --- a/rannak/mangud/perenaine/kuulamine/script.js +++ b/rannak/mangud/perenaine/kuulamine/script.js @@ -6,11 +6,18 @@ document.addEventListener('DOMContentLoaded', () => { const cells = document.querySelectorAll(".toBeEdited"); -console.log(cells); + +// For Checking +firsts = document.querySelectorAll(".firstCheck"); +secs = document.querySelectorAll(".secCheck"); +thirds = document.querySelectorAll(".thirdCheck"); + + + + for (let i=0;i < cells.length; i++){ cells[i].onclick = function(){ - console.log('Clicked'); if (this.hasAttribute('data-clicked')) return; @@ -41,7 +48,6 @@ for (let i=0;i < cells.length; i++){ td.removeAttribute('data-text'); td.innerHTML = curText; td.style.cssText = 'padding: .5rem .5rem'; - console.log('Sth Change'); } else { td.removeAttribute('data-clicked'); @@ -52,7 +58,15 @@ for (let i=0;i < cells.length; i++){ // Here Check if Done - //TODO + if (firsts[0].textContent != '' && firsts[0].textContent == firsts[1].textContent){ + if (secs[0].textContent != '' && secs[0].textContent == secs[1].textContent){ + + if (thirds[0].textContent != '' && thirds[0].textContent == thirds[1].textContent) + moveOnEnable(); + + } + } + @@ -80,17 +94,6 @@ for (let i=0;i < cells.length; i++){ -/// Chekers Funcers /// - - - - - - - - - - // If Done |