title: Enable and Disable input field using Javascript
body: <p>I have write some simple code which would make input field enabled and disabled on button click but it is not responding.
  please help me...!!!</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;script type="text/javascript"&gt;
          function toggleEnable(el1, el2) {
              document.getElementByID(el1).disabled = true;
              document.getElementByID(el2).disabled = true;
          }
      &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;form&gt;
          &lt;table&gt;
              &lt;tr&gt;
                  &lt;td&gt;&lt;input id="input1" class="myText" type="text" placeholder="Row 1" /&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;input id="input2" class="myText" type="text" placeholder="Row 1" /&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;button onclick="toggleEnable('input1','input2')"&gt; Enable/Disable &lt;/button&gt;&lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;&lt;input id="input3" class="myText" type="text" placeholder="Row 3" /&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;input id="input4" class="myText" type="text" placeholder="Row 4" /&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;button onclick="toggleEnable('input3','input4')"&gt; Enable/Disable &lt;/button&gt;&lt;/td&gt;
              &lt;/tr&gt;
          &lt;/table&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>