JS - Check if the input field equals the solution

前端 未结 3 566
孤街浪徒
孤街浪徒 2021-01-24 08:34

I\'m making a simple website for little kids with mathproblems,

the page contains a number of questions that the kids need to solve. They can press on 1 button that chec

3条回答
  •  粉色の甜心
    2021-01-24 08:45

    You have to give an input box an unique ID. Then, you can obtain its value like this:

    var value = document.getElementById("your-id").value;
    

    Full code: http://jsfiddle.net/7uwNn/

    Good luck with your project!

提交回复
热议问题