i use angularjs and i have created a normal input field like this:
i
You can bind method B to angular's ng-blur directive to detect when an input loses focus