Go Around The Tech Corner…

Posts Tagged ‘javascript popup messages

Often you’ll see messages popping up to alert you about something or to give you extra information on something. These can be programmed using JavaScript and it’s very simple. See the code below – It’s easy to understand.


<html>
<head>
<title>Displaying Alerts with JavaScript</title>
<script language = "JavaScript">
<!--
function m_alert()
{
alert('Do not Click..!!!');
alert('I Told You Not To Click Me..!!');
alert('Why Did You Click???!!!');
alert('You Will Never See Me Again!!!');
}
-->
</script>
</head>
<body>
<a href="#" onMouseover = "m_alert()"> Dont Click This Link </a>
</body>
</html>

Simply copy the code above, paste it into a notepad file and save the file with a .html extension, e.g. alerts.html.

The link has a mouseover function which calls the JavaScript funtion when you hover it. When writing JavaScript code, always remember to end the lines of code with a semicolon (;). Try and see how it works! You can use alerts in your websites to pass on certain messages easily.

– Millie


Me – The author of this blog!


This is my tech blog. I got another blog, full of jokes that will crack u up! http://humoraddict.blogspot.com

Follow milliepatel84 on Twitter

Blog Stats

  • 44,992 hits

Top Clicks

  • None

Flickr Photos