How can i set the value read-only by java script in input html (by class read)?
HTML
<input type="time" class="start" />
<select class="selectboxlist" >
<option>
<option>
<option>
<option>
...
</select>
Tired following in Java Script
if (selectboxlist.selectedIndex == 2 || selectboxlist.selectedIndex == 13 || selectboxlist.selectedIndex == 14) {
start.value = "00:00"; // works
start.setAttribute.readonly = true; // doesnt work
}
start.setAttribute('readonly', true). Orstart.readOnly = true.