$("#itemids").keypress(function(){
var value = $(this).val().replace(" ", "");
var words = value.split(",");
$("#counter").html(words.length);
});
This function works well with keyboard. But when I use barcode scanner, (I'm just focusing cursor on textarea and it starts to scan barcode into textarea by delimiters like comma.) it doesn't work at all.
I think it must be something other than keypress(function() . Because bc scanner enters words programmatically. How to get it work for both situations: keyboard and bc scanner?