title: jQuery Mask - Conditional
body: <p>I am very new to jQuery and am using the masked input plugin version 1.3 to create a mask for phone numbers.</p>
  
  <p>I was able to set it up and have the mask work correctly, however I would like to apply a condition for the mask based upon a select box change.</p>
  
  <p>When the page loads a select box with the id of #Country is loaded an is set to have 'United States' selected by default.  What I am trying to create is if they change the country selector to something other than the United States choice, remove the mask.</p>
  
  <p>This is my first attempt!</p>
  
  <pre><code>    $('#Country').change(function(){
      var cty = $(this).find('option:selected').attr('value');
      if(cty=='United States'){
          // us masking
          $('#phone').unmask().mask("(999) 999-9999");
  
      } else {
          // just numbers for international
          $('#phone').unmask().mask("9999999999999999");
  
      }
  });
  </code></pre>