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="JavaS cript"><!--
var name;
name=prompt("Pl ease 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="JavaS cript">
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="JavaS cript"><!--
var name;
name=prompt("Pl ease 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="JavaS cript">
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
Comment