Button to loose focus after close of popup window

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ismailc
    New Member
    • Sep 2006
    • 200

    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!
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    maybe something like
    Code:
    window.opener.focus();
    window.close();
    could work.

    Comment

    • ismailc
      New Member
      • Sep 2006
      • 200

      #3
      No luck, I tried on the same event:
      Code:
      onMouseUp="window.open(); window.opener.focus();window.close();"
      the same result - please assist!

      Comment

      • Dormilich
        Recognized Expert Expert
        • Aug 2008
        • 8694

        #4
        futile. of course you have to call this snippet in the opened window (where should window.opener come from in a normal window?)

        Comment

        • ismailc
          New Member
          • Sep 2006
          • 200

          #5
          i have tried but no luck

          Comment

          • Dormilich
            Recognized Expert Expert
            • Aug 2008
            • 8694

            #6
            I’m not that good with focus(), but I could prove the concept with alert()

            Comment

            • ismailc
              New Member
              • Sep 2006
              • 200

              #7
              not sure what to do !

              Comment

              • acoder
                Recognized Expert MVP
                • Nov 2006
                • 16032

                #8
                Have you tried blur(), or giving focus to another element?

                Comment

                • ismailc
                  New Member
                  • Sep 2006
                  • 200

                  #9
                  Thanks onBlur(); works great :)

                  Comment

                  Working...