I am using the OnClick alert on my web site to provide information about various subjects and the below code works fine:
<a href="#" onclick="alert('**** *****')">3</a>
it displays the desired information on a single line,
however, some times I want multiple lines of info to be displayed but I can't seem to make it work. I've used the <br> and <br /> codes but that doesn't work.
Can someone provide a better way?
jimk
PayneLess Designs
Joined: 28 Feb 2007
Posts: 3593
Location: Biloxi, MS
Posted: Fri Jul 17, 2009 3:16 pm
Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html><head>
<title></title>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<script type="text/javascript"><!--
function disp_alert()
{
alert("Hello world! This is how to" + '\n' + "add line breaks to an alert box!")
}
//--></script>
</head>
<body>
<p><input type="button" onclick="disp_alert()" value="Display Alert Box" /></p>
</body></html>
jimk
Joined: 20 Nov 2006
Posts: 7
Posted: Sat Jul 18, 2009 2:21 am
Thanks for the help.
jimk
PayneLess Designs
Joined: 28 Feb 2007
Posts: 3593
Location: Biloxi, MS