title: jQuery masked input plugin. select all content when textbox receives focus
body: <p>This is a followup question to this question:</p>
  
  <p><a href="https://stackoverflow.com/questions/480735/select-all-contents-of-textbox-when-it-receives-focus-javascript-or-jquery">select all contents of textbox when it receives focus (Javascript or jQuery)</a></p>
  
  <p>Basically I am using a textbox in conjunction with the <a href="http://plugins.jquery.com/maskedinput/" rel="nofollow noreferrer">jQuery masked input plugin</a>(Edit: Link may no longer point at relevant version)</p>
  
  <p>When the masked input textbox receives focus I want to select all of the contents of that textbox, but it seems as though having this plugin binded to the textbox prevents that. I was just wondering if there was a way around this.</p>
  
  <p>Below is a sample .html page that demonstrates the issue:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;input id="masktest" type="text" value="01/01/2009" /&gt;
      &lt;br /&gt;
      &lt;input id="focustest" type="text" value="on focus will select all contents..." /&gt;
  
      &lt;script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="http://jquery-joshbush.googlecode.com/files/jquery.maskedinput-1.2.1.pack.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript"&gt;
          $(function() {
              $("#masktest").mask("99/99/9999");
  
              // Contents of textboxes will be selected when receiving focus.
              $("input[type=text]")
                  .focus(function() {
                      $(this).select();
                  });
          });
      &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>