<html>
<body background="moon.jpg">
<p>Click the button to get a "Good Day" greeting if the time is less than 20:00.</p>
<button onclick="myFunction()">
Try it </button>
<p id="demo"></p>
<script>
function myFunction()
{
var x"";
var time=newDate().gethours();if(time<20)
{
x="Good day";
}
document.get ElementbyId("demo").
inner HTML=x;
}
</script>
</body>
</html>
Walang komento:
Mag-post ng isang Komento