title: Make text box editable using JavaScript
body: <p>I've a textbox with <code>readonly="readonly"</code> that means I can not edit it. But what I want is to make this textbox editable when user double clicks on it.</p>
  
  <p>What I've tried yet is:</p>
  
  <pre><code>&lt;input size="10" readonly="readonly" ondblclick="setEditable(this)"/&gt;
  </code></pre>
  
  <p>and in JavaScript:</p>
  
  <pre><code> function setEditable(i){
       i.readonly = false;
   }
  </code></pre>
  
  <p>But this does not worked. So <strong><em>how can I make a textbox editable, which is readonly, when user double clicks on it?</em></strong></p>