javascript - Safari and Chrome: problem editing input 'size' attribute on the fly -


I have the following code to create an automated text input text:

  // setup Quick jump input $ ("#goto") keydown (function (e) {var size = $ (this) .val (). Length; // sanitie if (size & lt; 1) {size = 1; } $ (This) .attr ("size", size); // then GOTO-> gt; e.keyCode == 13 {window.location.href = "/" + $ (this) .val ( );}});  

HTML:

  & lt; Input type = "text" id = "goto" size = "1" name = "goto" />  

problem: changing the size of the input Safari or Chrome In Firefox, Opera and Opera I'm using jquery 1.3.2 and would like to know that this is a bug in jquery or my implementation.

Edit: Sorry I was not clear enough at all - this is the part where I am trying to update the size of the input on a broken flight, my mistake. Thanks for the feedback, so far some very useful links.

I suspect that the size attribute will work cross browser Instead of changing the properties of the shape, I can switch to set the maximum length and CSS width of the input field.

Webkit looks like a bug / unsupported feature Which Safari / Chrome Share


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -