<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!--
function replaceChars(entry) {
out = "a"; // se digitar está letra
add = "k"; // troca por essa
temp = "" + entry;
while (temp.indexOf(out)>-1) {
pos= temp.indexOf(out);
temp = "" + (temp.substring(0, pos) + add +
temp.substring((pos + out.length), temp.length));
}
document.subform.text.value = temp;
}
//-->
</script>
</HEAD>
<BODY>
<center>
<form name="subform">
<input type=text name=text size=40 value="aaabbb"><br>
<input type=button name=action value="mudar!" onClick="replaceChars(document.subform.text.value);">
</form>
</center>
</BODY>
</HTML>