I have an input text box with an onfocus and an onblur event. Under the text box is a div which is hidden by with display: none. The div should be displayed if text box is focused and hide if blurred. This seem to work. Now I want to let the div stay visible or do any clicks on div
Tag: onblur
How to implement onBlur/onFocus for a div with nested input fields?
There is a <div> and a couple of nested <input>s. onBlur fires every time user clicks on one of the <input>s. This is a bit frustrating that onBlur happens when I hit something inside the div. After an hour of searching I still wasn’t able to find any good solution. This sample of code shows what I’m talking about: You
Keep the selection in a textarea
Can I prevent the loss of selection in the “onblur” event? Answer I don’t think that’s a good idea. A user with mouse in his/her hand can click anywhere on the page. If you get him/her back into the textarea, it won’t be following the principles of web accessibility.