Currently, I have a button in the form of html that performs a function on click:
<input type="button" onclick="do_action_1();">
But I have two functions:
do_action_1()
do_action_2()
I also have two text fields:
<input id="tb1" type="text" name="textbox1">
<input id="tb2" type="text" name="textbox2">
If the user cursor is in text box 1, I want the button to execute
do_action_1
but if the user cursor is in textbox2, I want the button to execute
do_action_2.
I'm not sure where to start when this is done, so any help is greatly appreciated.
source
share