Replace input in real time with jQuery -


i have problem script, want replace entered in input field specific letter in real time, hello world in field.

 <input id="inputid" type="text" value="" maxlength="11"/>  $('#inputid').keyup(function(e){   var cv=["h","e","l","l","o"," ","w","o","r","l","d",""];    var i=$('#inputid').val();    (j=0;j<11;j++){      this.value = this.value.replace(i[j],cv[j]);  }  }); 

this script works when write not when write quickly. help

try way:

$('#inputid').keyup(function(e){      var cv = 'hello world';      this.value = cv.substr(0, this.value.length); }); 

see working demo.


Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Automatically create pages in phpfox -

c# - Farseer ContactListener is not working -