diff --git a/index.html b/index.html index 19d0dee..26b5e05 100644 --- a/index.html +++ b/index.html @@ -19,9 +19,19 @@

Welcome to Tic Tac Toe

- - - + + + + + + + + + + + + + diff --git a/scripts.js b/scripts.js index ba09e74..41d53fe 100644 --- a/scripts.js +++ b/scripts.js @@ -10,8 +10,6 @@ let currentMarker = 'X' - - // this "handleClick" function is called when a box is clicked. Here, "element" will hold the same value as "this" does in the HTML. // "this" is a special word in JS but "element" could have been "thing" or "el" or whatever we wanted it to be as long as we use it again in the "console.log" statement const handleClick = (element) => { @@ -27,15 +25,6 @@ const handleClick = (element) => { } - - - - - - - - - // this function places the "currentMarker" inside the HTML element that was clicked and calls the "changeMarker" function. const addMarker = (id) => { @@ -50,8 +39,9 @@ const addMarker = (id) => { // .getElementById(id) // document // .innerHTML +document.getElementById(id).innerHTML = currentMarker - changeMarker() +changeMarker() } @@ -83,10 +73,11 @@ const changeMarker = () => { // This "resetBoard" function is called when the user clicks on the "Restart" button. const resetBoard = () => { - + + // @TODO-3: To make your "Restart" button work you'll need to build a line of code here that: // collects all of the "td" elements into an HTML Collection: https://www.w3schools.com/jsref/dom_obj_htmlcollection.asp - + const squares = document.getElementsByTagName('td') // @TODO-3.5: MIX & MATCH, You will need the following pieces of code to build that line: // squares // .getElementsByTagName("TD")