Description of the situation: I have two inputs, The first means the start time, the second means the end time.
What I want to come to: so that you cannot enter a time less in the end time field ("id_end _" + i) than it is entered in the start value field ("id_start _" + i)
Attentions: I warn you that you cannot move html code. I have more inputs than specified in the html code (over 20), so the loop must stay
Code html:
<td id="td01" class="InputsForUserColor1">
<input class="time_sea" type="time" id="id_start_1" />
<input class="time_sea" type="time" id="id_start_2" />
</td>
<td id="td01" class="InputsForUserColor2">
<input class="time_sea" type="time" id="id_end_1" />
<input class="time_sea" type="time" id="id_end_2" />
</td>
I tried: listens for inputs start change
var elements_i = document.getElementsByClassName("InputsForUserColor1")
for (var i = 0; i < elements_i.length, i++) {
elements_i.addEventListener("change", function (e) {
document.getElementById("id_end_" + i).setAttribute.(..) = document.getElementById("id_start_" + i).value
});
}
if I'm going the wrong way please let me know...