I have a problem with this script, I want to replace anything entered in the input field with a specific letter in real time, with Hello World in the 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();
for (j=0;j<11;j++){
this.value = this.value.replace(i[j],cv[j]);
}
});
This script works well when I write slowly but not when I write quickly. thanks for your help