What is the correct JavaScript syntax for opening a new window called "window5" ?


Correct Option: B

AI Explanation

To answer this question, you need to understand the JavaScript syntax for opening a new window.

Let's go through each option to understand why it is correct or incorrect:

Option A) new("http://www.ex-designz.net","window5") - This option is incorrect because the new keyword is used for creating instances of objects, not for opening new windows.

Option B) window.open("http://www.ex-designz.net","window5") - This option is correct. The window.open() method is used to open a new window. The first parameter is the URL of the page to be loaded in the new window, and the second parameter is the name of the new window.

Option C) open.newwindow("http://www.ex-designz.net","window5") - This option is incorrect because the correct syntax is window.open(), not open.newwindow().

Option D) new.window("http://www.ex-designz.net","window5") - This option is incorrect because the correct syntax is window.open(), not new.window().

The correct answer is Option B) window.open("http://www.ex-designz.net","window5"). This option is correct because it uses the correct syntax for opening a new window in JavaScript.

Find more quizzes: