title: Switch HTML ID Attribute Value Between HTML Text-Boxes Using JavaScript
body: <p>I have stack of HTML Text-Boxes (More than 2) in my HTML Form. When the HTML Page loads for the 1st time  the ID attribute is empty. But when a user clicks on a text-box the ID should be "active". Others should be empty. When the user clicks on another, the previous text-box's id should be empty. The new text-box's id should be "active". </p>
  
  <pre><code>&lt;input type="text" name="test" id="active"&gt;
  &lt;input type="text" name="test" id=""&gt;
  &lt;input type="text" name="test" id=""&gt;
  &lt;input type="text" name="test" id=""&gt;
  &lt;input type="text" name="test" id=""&gt;
  &lt;input type="text" name="test" id=""&gt;
  </code></pre>
  
  <p>How can I do this using JavaScript? Could you someone can help me to solve this matter?</p>
  
  <p>Thanks and regards,
  Chiranthaka.</p>