Reina
Reina

Reputation: 315

Closing popup window from the popup

I'm opening a window using this javascript:

function popitup(url) {
        newwindow=window.open(url,'name','height=430,width=780,scrollbars=1,resizable=1');
        if (window.focus) {newwindow.focus()}
        return false;
    }

I need to close this popup from the popup window itself using a close button, I tried this but it didn't work:

onClick="window.close()"

How can I achieve this?

Upvotes: 0

Views: 114

Answers (1)

Qasim Javaid Khan
Qasim Javaid Khan

Reputation: 660

try this putting an anchor tag on the popup

 <a href="JavaScript:window.close()">Close</a>

Upvotes: 1

Related Questions