Results 1 to 3 of 3

Thread: Button to loose focus after close of popup window

  1. #1
    Join Date
    Dec 2007
    Posts
    88
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Question Button to loose focus after close of popup window

    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?

    Code:
    onMouseUp="window.open("
    Please Assist!

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    In some browsers, selected and clicked may be beyond your control. But focus is easy enough:

    Code:
    onmouseup="this.blur();window.open(' . . . ');"
    You may even be able to change it's selected status by selecting another form element:

    Code:
    var s = document.forms.formName.elements.elName;
    s.focus(); s.select();
    However, it's having been clicked may be beyond the control of javascript.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Dec 2007
    Posts
    88
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Wink

    Thank You - works great

    Code:
    this.blur();

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •