我有 HTML。
Name 1:<input type="text" class="one" id="mytext">
<button onclick="disfunction()"></button>
Javascript
function disfunction(){
document.getElementsByClassName("one").disabled = true;
}
但是文本框仍然启用。我该如何使用classname在JAVASCRIPT中禁用text box
。
使用id可以做到这一点。也可以使用jquery。
但我需要使用Javascript
和classname
来解决。