如何在输入 html 中通过 java 脚本设置只读值(按类读取)?
HTML
<input type="time" class="start" />
<select class="selectboxlist" >
<option>
<option>
<option>
<option>
...
</select>
Run Code Online (Sandbox Code Playgroud)
厌倦了在 Java Script 中的跟随
if (selectboxlist.selectedIndex == 2 || selectboxlist.selectedIndex == 13 || selectboxlist.selectedIndex == 14) {
start.value = "00:00"; // works
start.setAttribute.readonly = true; // doesnt work
}
Run Code Online (Sandbox Code Playgroud)