I currently have this function:
if (e.keyCode == 32){
var $cursor = $("#cursor")
$cursor.val("");
this.append("<span class = 'space'>-</span>");
$cursor.insertAfter(".space:last");
$cursor.focus();
}
I was wondering how one would add a whitespace for the span, right now I add a dash for testing.
Have you tried just using a space character?
If that doesn’t work, you can use
(nonbreaking space) instead of-.