Step 1: Understand JavaScript objects and methods.
In JavaScript, objects contain properties and methods.
A
method is a function that belongs to an object and performs a specific action.
The statement given in the question is:
document.write("Hello Students");
Here,
document is an object representing the HTML document, and
write() is a method associated with that object.
Step 2: Explain how the method works.
The
write() method is used to display text directly on a web page.
When the browser executes the JavaScript code, the text inside the parentheses is written into the HTML document.
Example:
document.write("Welcome to JavaScript");
This will display the message on the webpage.
Step 3: Analyze other parts of the statement.
document: This is an object representing the webpage.
Hello and
Students: These are simply words inside the string that will be displayed as text.
They are not JavaScript methods.
Step 4: Conclusion.
Therefore, the method used in the given statement is
write().