I am trying to determine the last character of a string in a text input field, but ignoring any characters to the right of the cursor. Essentially I want to determine the the character directly left of the cursor. So far I can only get characters based on there position within the string like this:
var str = $('#tBox').val();
var lastChar = str.charAt(str.length-1 );
<input type = "text" id = "tBox">
is what I'm asking possible? Thank you.