- prompt, confirm, alert
- Click on button for text
Example 1:
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
prompt("What is your name?");
confirm("It will be closed now.");
alert("Its goona be closed now.");
</script>
</head>
</html>
|
Example 2:
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
function papu()
{
document.getElementById("demo").innerHTML = "Hello World";
}
</script>
</head>
<style>
p
{
background-color:yellow;
color:red;
}
</style>
<body>
<button onclick="papu()">Click me</button>
<p id="demo"> </p>
</body>
</html>
|
No comments:
Post a Comment