-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
33 lines (24 loc) · 853 Bytes
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//console.log("JS file is connected to HTML! Woo!")
var cardOne = 'queen';
var cardTwo = 'quenn';
var cardThree = 'king';
var cardFour = 'king';
if (cardOne === cardThree) {
alert ('You did it! Yay!');
} else {
alert ('Smh. ☺ Try Again.');
// find the board and set it to a variable
// so that we can add cards to it
var board = document.getElementById('game-board');
// function that will create your board
function createBoard() {
// loop through your cards array to create card elements for your board
for (var i=0; i<cards.length; i++) {
// create a div element which will be used as a card
var cardElement = document.createElement('div');
// add a class to the card element which will help link styling
cardElement.className = 'card';
// append the card to the board
board.appendChild(cardElement);
}
}