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