I met some trouble with a javascript.
In fact I have in my database many records that are abreviations and ther equivalent,
for example, replace tel => telephon
When using keypress this way the code variable will contain the character code of the pressed character. Not the string of chars like the expected 'tel'. You could use onkeyup / onchange event and check the val() of the input element and use replace() to change the abbreviation to the intended string.
$('#tags').keyup(function(e){
var elem = $(this);
var input = elem.val();
// input = input.substr(0, input.length -1); // This might not be necessary
console.log(input);
// do the replacement
input = input.replace('tel','telephone');
elem.val(input);
}
});