From 42a7326d48964121f066f023eb08f5b9e76fec98 Mon Sep 17 00:00:00 2001 From: JunkJumper Date: Wed, 12 Feb 2020 18:36:12 +0100 Subject: [PATCH] =?UTF-8?q?fin=20s=C3=A9ance=201=20TD3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TD3/js/td3-exo1.js | 15 ++++++++------- TD3/js/td3-exo2.js | 8 ++++---- 2 files changed, 12 insertions(+), 11 deletions(-) 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