I have a question regarding my calculator in Jquery. It has 3 different text fields and when I use the number buttons, it writes in all three fields simultaneously because of using $("input[type=text]")
in the input declaration. I want to change this behavior by selecting only one input field. I considered giving an ID to each text field, but that would require writing a separate function for each ID, which seems unprofessional. What is the best way to write only in the input field on focus? Any help is appreciated. Here is the link to my fiddle for reference:
https://jsfiddle.net/2yuve11z/