I want to get the value of the textbox on keypress.
I have html code like
<input style="width: 20%; float: right;"
ng-model="que.SelectedOptionsUID"
type="text"
ng-keypress="myFunct($event)"/>
And JS code on my controller:
$scope.myFunct = function (e) {
var charCode = (e.which) ? e.which : e.keyCode;
//i want here value of the textbox
}
<input style="width: 20%; float: right;"
ng-model="que.SelectedOptionsUID"
type="text"
ng-keypress="myFunct($event, que.SelectedOptionsUID)"/>
Controller:
$scope.myFunct = function (e, myValue) {
var charCode = (e.which) ? e.which : e.keyCode;
// do something with myValue
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With