Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/429.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 当将禁用的输入从true更改为false时,为什么我不能单击输入?_Javascript - Fatal编程技术网

Javascript 当将禁用的输入从true更改为false时,为什么我不能单击输入?

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

我有一个将输入属性从true更改为false的函数。dom和css更新了,但我仍然无法单击或使用输入

<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);