0

I have my code:

<script language="javascript" type="text/javascript">
alert('This is what an alert message looks like.');
</script>

function showAlert() {
    var country = "Fiji";
    var city = "Suva";
    alert('The city of ' + city + ' is located in ' + country + '.');
}

<input type="button" value="Click Here" onClick="showAlert();">

the result is:

The city suva is located in Fiji.

K fine My doubt is: AlerBox contains "The page at localhost:1234 says".Here I want to define user-defined statement.How is it possible in javascript.

Help, please!

Vikrant
  • 4,920
  • 17
  • 48
  • 72
Santu Srinu
  • 101
  • 3
  • 11

2 Answers2

3

That message can not be modified at all. Your only option is to create your own html/javascript alert window but it won't be truly modal. You can at best give the illusion of a modal window.

Roman
  • 10,309
  • 17
  • 66
  • 101
1

Use a custom-made alert. http://www.codeproject.com/KB/scripting/DOMAlert.aspx

Ashwin Krishnamurthy
  • 3,750
  • 3
  • 27
  • 49