J
joemac
I'm just starting out with javascript and the following is not working
as it should. The expected prompt dialog box never appears.
<head>
<script language="JavaScript"><!--
var name;
name=prompt("Please enter your name.","");
document.write("My name is: ", name);
// --></script>
</head>
<body>
<p>Did it work out ok?
</body>
</html>
I've tried replacing
<script language="JavaScript">
with
<script type="text/javascript">
but this makes no difference in the results, which are as follows:
My name is:
Did it work out ok?
What am I doing wrong?
Joe
as it should. The expected prompt dialog box never appears.
<head>
<script language="JavaScript"><!--
var name;
name=prompt("Please enter your name.","");
document.write("My name is: ", name);
// --></script>
</head>
<body>
<p>Did it work out ok?
</body>
</html>
I've tried replacing
<script language="JavaScript">
with
<script type="text/javascript">
but this makes no difference in the results, which are as follows:
My name is:
Did it work out ok?
What am I doing wrong?
Joe