diff --git a/TD3/js/td3-exo1.js b/TD3/js/td3-exo1.js index bad24cc..f1ab6f1 100644 --- a/TD3/js/td3-exo1.js +++ b/TD3/js/td3-exo1.js @@ -17,11 +17,12 @@ function selection(event) { var vide = document.body.querySelector(".case.vide"); if ((maCase.offsetTop == vide.offsetTop && Math.abs(maCase.offsetLeft - vide.offsetLeft == 102)) || - (maCase.offsetLeft == vide.offsetLeft && Math.abs(maCase.offsetTop - vide.offsetTop == 102)) { - maCase.setAttribute("class", ".case.vide"); - vide.setAttribute("class", ".case"); - } + (maCase.offsetLeft == vide.offsetLeft && Math.abs(maCase.offsetTop - vide.offsetTop == 102))) { + console.log("1"); + maCase.className = "case vide"; + vide.className = "case"; + } - console.log(event.currentTarget.innerText); - var e = event.target; - } \ No newline at end of file + console.log(event.currentTarget.className + " : " + event.currentTarget.innerText); + var e = event.target; +} \ No newline at end of file diff --git a/TD3/js/td3-exo2.js b/TD3/js/td3-exo2.js index 647f2e2..37341b3 100644 --- a/TD3/js/td3-exo2.js +++ b/TD3/js/td3-exo2.js @@ -1,5 +1,5 @@ -/**/ \ No newline at end of file +function init() { + console.log("init ok"); +} \ No newline at end of file