Well, Let us write an example that shows an alert message from browser.
So, how to proceed it?
Yes. It’s quite simple. Just place the message that needs to be displayed in alert box in double quotes.
The same ' Welcome to Spider ' in an alert box
window.alert("Welcome to Dotnetspider Tutorails");
So the output in the browser would be an alert box with Welcome to dotnetspider tutorials
What will happen if you don't specify any arguments in the alert method? Does it give an Error?
Just check and see.
Well, it doesn't give any error but you will get an alert box but no message is shown since we didn't specify any message.
The only part of an alert box you have control over is the text.