diff --git a/app/app.js b/app/app.js new file mode 100644 index 00000000..3613f905 --- /dev/null +++ b/app/app.js @@ -0,0 +1,12 @@ +function startGame() { + // starting new game + var messagesElement = document.getElementById('messages'); + // reference to the messages div inside the index.html file // + messagesElement.innerText = 'Welcome to MultiMat! Starting a new game... '; + // Assigns a string to it's innerText property so that it will appear on the screen // +} +document.getElementById('startGame').addEventListener('click', startGame); +// calls start game function when the start game button is clikced in the app // + + +// BEFORE WE CAN USE THIS NEW JS FILE IN THE APP WE NEED TO ADD A REFERENCE TO IT IN THE INDEX.HTML FILE // diff --git a/app/app.ts b/app/app.ts index e69de29b..dccc32bd 100644 --- a/app/app.ts +++ b/app/app.ts @@ -0,0 +1,10 @@ +function startGame() { + // starting new game + var messagesElement = document.getElementById('messages'); +// reference to the messages div inside the index.html file // + messagesElement.innerText = 'Welcome to MultiMat! Starting a new game... '; +// Assigns a string to it's innerText property so that it will appear on the screen // + } + + document.getElementById('startGame').addEventListener('click', startGame); + // calls start game function when the start game button is clikced in the app // diff --git a/index.html b/index.html index c6365185..e5223a2f 100644 --- a/index.html +++ b/index.html @@ -55,7 +55,7 @@