Multiple choice technology web technology

From the current browser window, how to change the URL of the browser window which opened this current window ?

  1. window.parent.location='newpage.html'

  2. window.top.location='newpage.html'

  3. window.opener.location='newpage.html'

  4. Cannot be done

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

In JavaScript, window.opener refers to the window that opened the current window. To change its URL, you assign a new value to window.opener.location. window.parent and window.top refer to iframe hierarchies.