Enable/ Disable for the textfield with same ID
<p>I have two field named  "Input1" and "Input2" with id as "inputID". 
If I click "Input1" field,Input2 field to be disable. 
And after reset, If I click "Input2" field,Text" Input1 should be disable. 
I can able to achieve this by different id in javascript. But I need to get this with same id.
Can anyone please me on this?</p>

<pre><code>&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;body&gt;
&lt;script&gt;
function myFunc1() {
var input1 = document.getElementById("input1");
var input2= document.getElementById("input2");
if (input1.click){
  document.getElementById("input2").disabled=true;
 } 
}
function myFunc2() {
var input1 = document.getElementById("input1");
var input2= document.getElementById("input2");

if (input2.click) {
  document.getElementById("input1").disabled=true;
}
}
&lt;/script&gt;
&lt;table&gt;
  &lt;tr&gt;
    &lt;td&gt;Field1: &lt;input type="text" id="input1" onclick="myFunc1();" /&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;Field2  : &lt;input type="text" id="input1" onclick="myFunc2();" /&gt;&lt;/td&gt;
  &lt;/tr&gt;

&lt;/table&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>