Wednesday, 15 July 2015

jQuery or Javascript: detecting if the text caret has left an element? -


What's the way, via jQuery or regular JavaScript, to ascertain whether the user's text carat element Has gone out (such as a TD, Divi, Spain, etc.)?

The scenario is: I have a table of the Texbox that is grouped into a span element inside a pair. I am verifying the entries in the pair, but as long as the user has another pair of text boxes ( I.e. the second period), I do not want verification errors to pop up.

Maybe I am going about it wrongly, but in my mind I am thinking that when the user has switched out, then the pair must be verified. But I need to know how the carat has progressed in another span element. I can not rely on the position of the mouse because a user can easily flip the mouse pointer during entries in some other place.

You can use the focus loses event

  & Lt; Input type = "text" onblur = "myfunction ()" & gt;  

or

  $ ("input"). Focus Out (function () {// do Somthing;});  

No comments:

Post a Comment