Saturday, March 6, 2010

create dialogbox with javascript

this example will create an "pop up" that ask user input, enjoy it











<html>


<head>


<script type="text/javascript">
alert("Welcome!")
var answer=confirm("Enter website?")
if (answer)
window.location=<a href="http://suryaadinugraha.blogspot.com">http://suryaadinugraha.blogspot.com</a>

</script>


</head>


<body>


<script"text/javascript">
var answer=prompt("who are you?")
alert("Hallo "+answer)
</script>


</body>


</html>

1 comment: