I'm using this script to automatically place a comma space after each item you type and press the spacebar.
But for some reason I can not figure out how to make it backspace at all.
I would prefer it to be able to delete a whole item and trailing comma with each backspace.
$('#textarea').keyup(function(){
var str = this.value.replace(/(\w)[\s,]+(\w?)/g, '$1, $2');
if (str!=this.value) this.value = str;
});
<textarea id='textarea'>item1, item2, item3</textarea>