I have HTML
Name 1:<input type="text" class="one" id="mytext">
<button onclick="disfunction()"></button>
Javascript
function disfunction(){
document.getElementsByClassName("one").disabled = true;
}
But the text box is still enabled. How can I disable text box
using the classname in JAVASCRIPT.
Using id I can do this. Also using jquery.
But I need a solution using Javascript
and classname
.