I have a "parent div" containing a child box input type=number
. When user clicks outside of input box I use blur
or focusout
event of parent div to use input values at some other place.
I also need to use $('inputbox').trigger('focus')
at some place, which fires "parent div"'s blur event unwantedly and runs code on that event.
Please give a solution to stop this parent blur event on child's focus OR give a way to find whether focus is made by trigger('focus') on child element or by user clicking outside of parent div.
I need to fire parent Blur only when user clicks outside of it & not when focus is triggered through code.