Type/paste stuff here.
myinp=document.forms.form1.inp.value;
myinp=myinp.replace(/a/g,'b');
document.forms.form1.inp.value=myinp;