mirror of
https://github.com/10h30/odin-etch-a-sketch.git
synced 2026-07-11 18:55:58 +09:00
Add check grid size smaller than 10
This commit is contained in:
@@ -3,10 +3,18 @@ const containerWidth = document.querySelector(".container").clientWidth;
|
|||||||
console.log(containerWidth)
|
console.log(containerWidth)
|
||||||
|
|
||||||
const button = document.querySelector("button")
|
const button = document.querySelector("button")
|
||||||
|
let size = 0
|
||||||
button.addEventListener('click', () => {
|
button.addEventListener('click', () => {
|
||||||
|
do {
|
||||||
let gridSize = prompt("Please enter grid size: ")
|
let gridSize = prompt("Please enter grid size: ")
|
||||||
makeGrid(gridSize)
|
size = gridSize
|
||||||
|
console.log(size)
|
||||||
|
if (size > 100) {
|
||||||
|
alert("Please enter number smaller than 100")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
while (size > 100);
|
||||||
|
makeGrid(size)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user