I am creating a website and would like to make a tool using JavaScript to choose someone's skateboard size depending on their shoe size. This is the code I am using:
const shoeSize = document.getElementById('shoeSize').value
let boardSize = ''
switch (shoeSize) {
case 0 <= 7:
boardSize = '7.75'
break;
case 8,9:
boardSize = '8'
break;
case 10,11:
boardSize = '8.25'
break;
case 12,13:
boardSize = '8.38'
break;
case 14 >= 20:
boardSize = '8.5'
break;
default:
boardSize = '?'
document.write(boardSize)
}
<p>
Most people pick their board size by prefrence but I will make a tool below to choose a board size that will fit your shoe size best. The most popular board sizes are 7.75, 8, 8.25, 8.38, and 8.5. <br> <br>
If your shoe size is: <input id='shoeSize' type="text" class="shoe">. The best board size for you would be:
</p>
No matter what I type into the text box there is always a "?" that shows up on my website. What can I do/ change to fix this. What I want to happen is if someone types for example "10" into the text box, "8.25" should be printed. I would also appreciate any other tips to improve my code.