0

I need to focus the existing parent window tab in the browser while closing the child window popup. But i can able to do for opening new parent window and focus it. Is that possible to open the existing parent window browser tab with focused?.

My code

function closepopup() {
        var winRef = window.opener.location;
        var parentwindow = window.open(winRef, '');
        parentwindow.focus();
        window.close();
        return false;
    }
Umapathy
  • 83
  • 11
  • "But i can able to do for opening new parent window and focus it." -- I don't understand this at all. – pennstatephil Apr 15 '14 at 16:27
  • possible duplicate of [How to return focus to the parent window using javascript?](http://stackoverflow.com/questions/6910278/how-to-return-focus-to-the-parent-window-using-javascript) – pennstatephil Apr 15 '14 at 16:29

1 Answers1

0

Check below code

window.opener.document.forms(0)." & Your Parent Control Id & ".focus();
window.close();
return false;
Pragnesh Khalas
  • 2,908
  • 2
  • 13
  • 26