Javascript 当将禁用的输入从true更改为false时,为什么我不能单击输入?
我有一个将输入属性从true更改为false的函数。dom和css更新了,但我仍然无法单击或使用输入Javascript 当将禁用的输入从true更改为false时,为什么我不能单击输入?,javascript,Javascript,我有一个将输入属性从true更改为false的函数。dom和css更新了,但我仍然无法单击或使用输入 <input id="playerLocation" type="text" name="location" oninput="setPlayerLocation()" disabled="true"> 您需要将removeAttribute用于禁用 playerLocation.removeAttribute('disabled') 用正确的行更新了js .player-det
<input id="playerLocation" type="text" name="location" oninput="setPlayerLocation()" disabled="true">
您需要将
removeAttribute
用于禁用
playerLocation.removeAttribute('disabled')代码>
用正确的行更新了js
.player-details input[disabled="true"] {
opacity: 0.6;
}
playerLocation.setAttribute('disabled', false);