Question:

Which of the following is an inbuilt function of JavaScript?

Show Hint

Common built-in JavaScript dialog functions include alert(), confirm(), and prompt().
  • validateForm()
  • form()
  • alert()
  • hello()
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is C

Solution and Explanation

Step 1: Understand built-in functions in JavaScript.

JavaScript provides several built-in functions that are already defined within the language. These functions allow developers to perform common tasks such as displaying messages, handling data, and interacting with the browser.

Step 2: Explain the alert() function.

The alert() function is a built-in JavaScript function used to display a popup message box on the screen. It is commonly used for notifications, warnings, or debugging purposes.

Example:

alert("Welcome to the website");
When executed, this statement shows a dialog box containing the message.

Step 3: Analyze other options.

validateForm(): This is usually a user-defined function created by developers for validating form inputs.

form(): This is not a standard JavaScript built-in function.

hello(): This is also not a built-in function and would normally be defined by a programmer if needed.

Step 4: Conclusion.

Therefore, the correct inbuilt function of JavaScript among the given options is alert().
Was this answer helpful?
0
0