Skip to content
Advertisement

Tag: onblur

onBlur event prevents onClick event

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

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.

Advertisement