View Full Version : Button to loose focus after close of popup window

10-21-2009, 09:29 AM
Good day, I need help.

I have an html button that calls & open another browser window on the onMouseUp event, but once I close the popup new browser window my button has focus & is like selected.

I want it not to be selected or clicked or has focus, how do i loose the focus after close of popup window?


Please Assist!

10-21-2009, 01:11 PM
In some browsers, selected and clicked may be beyond your control. But focus is easy enough:

onmouseup="this.blur();window.open(' . . . ');"

You may even be able to change it's selected status by selecting another form element:

var s = document.forms.formName.elements.elName;
s.focus(); s.select();

However, it's having been clicked may be beyond the control of javascript.

10-21-2009, 01:32 PM
Thank You - works great :)