I want to know if an event can be hit if the period sign . removed from text box. for example, I have a #Quantity text box that accepts numeric values as input with a period sign

and I have a #unitValue dropdown control which has three options
I successfully hit the event with a period sign . , in the following way
$("#Quantity").keypress(function(e) { if(e.which == 46) {
Now I want to enable the "Gram" option in the drop-down list if the period sign . removed from text box. I have an idea, but not if it is correct. Idea: - At any key press, add each letter to the array. Then press the backspace key to check if the letter in the array index is a period icon . or not if that . then turn on the "gram"
Any help would be appreciated
thanks
source share