I have this script JsFiddle and I am trying to change submitted characters, but when you press for ex: s twice as in ss instead of showing xx it changes it to ss
Full code:
<body>
<div id='out'></div>
<textarea id="in" name="messages" onkeyup="test()"></textarea>
<input type="submit" id="submit" name="submit" />
Js function:
function test(){
var origin = document.getElementById("in").value;
var send = document.getElementById("out");
if(origin =='s'){
origin = 'z';
}
send.innerHTML = origin;
}
</script>