I'd like to get the last deleted character on a backspace event, so that I can modify some other div accrodingly. The function that I'm looking for is like:
$('.tags').keyup(function (e) {
if (e.keyCode == 8) {
var t = e.target;
let deletcChar = //find the deleted character
console.log("deleted char is:", deletedChar);
//do something about deletcChar
}
});
the solutions that I found here (like this) are all massively complicated and based on keydown.
A simpler solution here uses (e.target.value[even.target.selectionStart - 1])
which does not work for keyup.
So I'm wondering if there is a strighforward way for keyup() in jquery?