Tutorials » Javascript tutorials »

More practical Approach

This article explains practical approach that we have learned in previous chapter

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



<script language=”text/javascript">

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.

Note: Please don't forget to place the message in double quotes. Otherwise you will get an error as JavaScript is case sensitive. Another point here it’s our choice to use single quotes or double quotes in an alert box while quoting text.

The only part of an alert box you have control over is the text.

Next Chapter: Working with confirm and prompt
Previous Chapter: Javacript popup objects!
More Chapters: Javascript Tutorials
More Tutorials: Tutorial Index

Top Contributors
    Last 7 Daysmore...

    Awards & Gifts

    Online Members

    Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India