title: readonly with jquery
body: <p>i'm trying to add readonly to all the inputs and then on the click remove the readonly to make it works for typing.
  the readonly set for all inputs part works but the remove on click doesn't work please help.</p>
  
  <p>my code :</p>
  
  <pre><code>&lt;script language="javascript"&gt;
  $(document).ready(function()
  {
  $('#secureFields :input').attr('readonly', true);
  
      $('.readonly').click(
      function()
      {
          if ($('.readonly').attr("readonly") == true)
          {
              $('.readonly').val('');
              $('.readonly').removeAttr("readonly");
          }           
      }); 
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>html is like this :</p>
  
  <pre><code> &lt;table class='table' id='secureFields'  &gt;
          &lt;tr&gt;
              &lt;td width=200&gt;First Name:&lt;/td&gt;
              &lt;td&gt;&lt;input readonly='readonly'  type='text'  name='firstname' size=30 class='required'/&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
  </code></pre>