title: javascript/ jquery focus issue in IE8 and before
body: <p>I have a small problem. </p>
  
  <p>currently, I have the following function for formatting currency on the focus/blur of an input text field:</p>
  
  <p><a href="http://jsfiddle.net/pimvdb/jFxBt/" rel="nofollow">jsfiddle</a></p>
  
  <pre><code>    $('.number').bind({
          focus: function() {
              $(this).val('$' + $(this).val());
          },
          blur: function() {
              var defVal = $(this)[0].defaultValue; 
              var dollars = $(this).val();
              dollars = dollars.replace('$', '');
              dollars = dollars.replace(',', '');
              dollars = parseFloat(dollars).toFixed(2);
              if (!(isNaN(dollars))) {
              $(this).val(dollars);
              } else {$(this).val(defVal).removeClass('inpt_validBlur');};
          }
      });
  </code></pre>
  
  <p>This works just as desired in Firefox, Safari, and IE9, but in prior versions of IE there is an issue. in IE, when you start typing, your text comes BEFORE the dollar sign, not after.  Does anyone know the reason for this and how to get around it?</p>
  
  <p>Thank you</p>