Hey there, I feel like you need to clarify more on your question to get the exact solution to your problem. From my understanding, you want the default input value to be 0 and and the same time if the value was empty, you want the system to make the value to be 0.
Below is my solution to the problem.
<body>
<input type="text" id="question_1" maxlength="2" placeholder="0">
<input type="text" id="question_2" maxlength="2" placeholder="0">
<input type="text" id="question_3" maxlength="2" placeholder="0">
<input type="text" id="question_4" maxlength="2" placeholder="0">
<input type="text" id="question_5" maxlength="2" placeholder="0">
<input type="text" id="question_6" maxlength="2" placeholder="0">
</body>
You can change the input type to [ type= "number" ] if you dont want anything besides number. The placeholder specifies a short hint that describes the default or specified value of an input so when someone types over it, it will simply disappear.
The next step for the empty value to be changed into value 0 is as below.
if(document.getElementById("question_1") || ("question_2") || ("question_3") || ("question_4") || ("question_5") || ("question_6") ).value.length == 0)
{
alert("value will be changed from empty to 0")
}
There are many examples online but i find this easier for poeple to understand the logic behind the code.