For example, I've got the below code where I'm trying to interpret just any character entered into the textfield as the first element from my arrayOfCharacters. This sort of works however on entering a second character, doesn't function. I was wondering if anyone's got an idea as to why this isn't working. Thanks!
let arrayOfCharacters = ["‛¯¯٭٭¯¯(▫▫)¯¯٭٭¯¯", "=^..^="]
document.getElementById("input-area").onkeypress = function(evt) {
let val = this.value
//Transform the typed characters
this.value = val + arrayOfCharacters[0]
}