select the text in a text field when clicked?
<p>how can you so that the text in the text field is selected when the user clicks on the text input field?</p>

<p>i have used this code:</p>

<pre><code>  $("input[type=text]").focus(function() {
      $(this).select();
  });
</code></pre>

<p>but it doesnt work in safari. and in FF it works sometimes.</p>
