 <p>this example as been tested on Chrome 25 and Firefox 19. (<a href="http://jsfiddle.net/9ezyz/" rel="nofollow">http://jsfiddle.net/9ezyz/</a>)</p> <pre><code>function input_update_size() { var value = $(this).val(); var size = 12; // Looking for font-size into the input if (this.currentStyle) size = this.currentStyle['font-size']; else if (window.getComputedStyle) size = document.defaultView.getComputedStyle(this,null).getPropertyValue('font-size'); $(this).stop().animate({width:(parseInt(size)/2+1)*value.length},500); //$(this).width((parseInt(size)/2+1)*value.length); } $('input') .each(input_update_size) .keyup(input_update_size); </code></pre>