alert() method examples in JavaScript

Sign up for an Office 365 SharePoint Online Business Subscription


In this post, we will discuss some examples of alert() method in javascript. Also, you can also check out my previous posts on:
Below are some examples:
Example-1:
 <script language=”JavaScript” type=”text/javascript”>
        alert(“Javascript dialog example”);
    </script>
Example-2:
In this example, we can see how we can show a message in the dialog box in multiple lines.
<script language=”JavaScript” type=”text/javascript”>
        alert(“JavaScript Alert\n Multiple Line Example”);
    </script>
Example-3:
In this example, we will see how we can show message from variables in a dialog box.
 <script language=”JavaScript” type=”text/javascript”>
        var firstmsg = “This is the first message! “;
        var secondmsg = “This is the second message! “;
        alert(firstmsg + secondmsg);
    </script>

You May Also like the Following SharePoint Online Tutorials:

About Bijay Kumar

I am Bijay from Odisha, India. Currently working in my own venture TSInfo Technologies in Bangalore, India. I am Microsoft Office Servers and Services (SharePoint) MVP (5 times). I works in SharePoint 2016/2013/2010, SharePoint Online Office 365 etc. Check out My MVP Profile.. I also run popular SharePoint web site SharePointSky.com

View all posts by Bijay Kumar →