Forum Moderators: open
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script type="text/javascript">
function lert(msg) {
alert(msg);
document.write(msg)
}
</script>
</head>
<body>
<input type="submit" name="Submit" value="Submit" onclick='lert("Hello World!")' />
</body>
</html>
The page displays the message "Hello World" in an alert box alright, and it then proceeds to print this value on the page, however, my browser's status bar seems to freeze on 50%?!?
Can anyone tell me why this is happening and how i would go about fixing it?
TIA
Toggo
Also, alert() may be causing the problem.
Also, onclick should generally return either true or false but when using a submit button, the <form onsubmit> attribute should be used rather than onclick.
e.g. <form onsubmit='lert("Hello World!");return true;'>
Kaled.