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...

Freshers Walkin at TATA AIG General Insurance Bangalore - on 24 Jan 2015

Bangalore Marketing / Sales Freshers Walkin Interview in TATA AIG General Insurance – January 2015 Job Title : Sales Executive for Bancassurance No of Posts : 3 Name of Company : TATA AIG General Insurance Company Limited Experience Required : 0 – 3 yrs Location of Job : Bengaluru/Bangalore Salary Package : INR 1,75,000 – 2,25,000 P.A Job Responsibilities : Incumbent will be involved in direct sales. Required : Should have strong aptitude for sales and Marketing Candidate has to Co ordinate with banks to generate leads. Fresher with two wheeler can apply. Walkin Date : 24 January 2015 Walkin Time : 11 AM Walkin Venue: 2nd floor JP & Devi Jambukeswar Arcade No.69 Millers Road Bangalore-560052 www.tataaiginsurance.in

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