I have multiple "input" from HTML.
<input type="text" id="m" />
<input type="text" id="m2" />
<input type="text" id="m3" />
<input type="text" id="m4" />
and I would like each of these to be checked if empty and then replaced with 0 in javascript I used the following
var m1 = document.getElementById('m1').value;
if (m1 === ""){
m1 = 0;
}
Is any simple way to check all the input text areas and then replace each empty with 0 value.