How do I know in which text field the cursor is located?

0

I am using angularjs and I need to know in which text field the cursor is located ?, I have a problem, it is that I create a keyboard on the screen and it writes depending on the text field where the cursor is since there are more than three text fields, how do I know which of the three is the cursor so that when using this keyboard the letters are written in the text field indicated?

this is my on-screen keyboard:

                            

                                <input type="button" value="3" class="mx-sm-3 btn btn-primary">




                <br><br>
                <input type="button" value="4" class="mx-sm-3 btn btn-primary">
                <input type="button" value="5" class="mx-sm-3 btn btn-primary">
                <input type="button" value="6" class="mx-sm-3 btn btn-primary">

                <br><br>
                <input type="button" value="7" class="mx-sm-3 btn btn-primary">
                <input type="button" value="8" class="mx-sm-3 btn btn-primary">
                <input type="button" value="9" class="mx-sm-3 btn btn-primary">

                <br><br>
                <input type="button" value="0" class="mx-sm-3 btn btn-primary">
                <input type="reset" value="." class="mx-sm-3 btn btn-primary">
                <input type="button" value="←" class="mx-sm-3 btn btn-primary">

and these are the fields:

 <input id="inlineFormInput" type="number" placeholder="Monto" ng-model="actual3.monto" class="mx-sm-3 form-control">

    
asked by Jhonatan Ramirez 04.02.2018 в 07:48
source

1 answer

1

I do not know if this is what you really need but there is the ng-mouseover directive

link

 <input ng-onmouseover="dondeEscribir= $event.currentTarget.id">

to save the input id in variable dondeEscribir , or directly $event.currentTarget and you keep the whole element.

    
answered by 04.02.2018 в 15:38