Skip to main content

Displaying Text in an Alert Dialog

In JavaScript we can display information in windows called dialogs (or dialog boxes) that "pop up" on the screen to grab the user's attention. Dialogs typically diplay important messages to users browing the web page. JavaScript allows you easily to display a dialog box containing a message.

The following program displays Welcome to JavaScript Programming! as three lines in a predefined dialog called an alert dialog.

Alert dialog box displaying multiple lines.

<html>
  <head>
    <title>Printing Multiple Lines in Dialog Box</title>
    <script type = "text/javascript">
      <!--
      window.alert( "Welcome to \n JavaScript\nProgramming!" );
      // -->
    </script>
  </head>
  <body>
    <p>Click Refresh to run this script again.</p>
  </body>
</html>

The script user the browser's window object to display an alert dialog. The argument to the window object's alert method is the string to display.

Popular posts from this blog

List of software companies in Chennai

List of software companies in Chennai India's Information technology is an industry consisting of IT services and business process outsourcing(BPO). In india information technology is playing an important role, IT sector in India is generating more than 3 million employment. IT & ITeS industry in India has grown enormously. Indian Information Technology has made a mark in the world. Many MNC's are started branches in Indian cities like Bangalore, Chennai, Delhi etc,. The below table shows you list of software companies in Chennai. 4i Apps Solutions Pvt Ltd http://www.4iapps.com Abra Technologies http://www.abratechnologies.com Accel Frontline Ltd http://www.accelfrontline.in Adrenalin eSystems Ltd http://www.myadrenalin.com Akmin Technologies Pvt Ltd http://www.akmin.com American Megatrends India Pvt Ltd http://www.amiindia.co.in Anantara Solutions Pvt Ltd http://www.anantsol.com Arrowpoint Technologies Pvt Ltd http://www.arrowpointtechn...

How CSS Style Sheets are Working ?

Without HTML it wont work. We can use Cascading Style Sheets in HTML document for interactivity, coloring, aligning contents in HTML pages and styling. It’s easy: 1. Start to write a HTML document(using tables or div tags). 2. Assign class or id to html elements 3. Write Style rules for the html elements, how you would like to display the perticular elements. 4. Attach the style sheet to the html document. When the browser displays the document, it follows your styles for rendering elements. How is it Please comment

How to use HTML textbox, buttons, checkbox and radio buttons ?

HTML is easy to learn here we are going to create textbox, buttons, checkbox and radio buttons for beginers. In Freshers Blog we gave many example for html programs. Generally textbox, buttons, checkboxs and radio buttons these components will help you to create interactive registration form. Example for textboxs, checkboxs bellow, <html>   <head>     <title>Welcome to Fresher Blog</title>     </head>   <body>     <input type="text" name="text1" ></input>     <input type="checkbox" name="checkbox1">Checkbox 1</input>     <input type="radio" value="Radio">Radio 1</input>     <input type="submit" value="Freshersblog"></input>   </body> </html> The above example beginners can learn html more quickly and easily. Thanks.