|
Help with website
Hello, my team is working on the website and were trying to do some java script but could not get it to work could someone tell me what is wrong with this simple script.
<html>
<head>
</head>
<body>
<h1>Team #</h1>
<p id="demo"></p>
<button type="button" onclick="displayDate()">Display Date</button>
<script type="text/javascript">
var a =1;
function displayDate()
{
a=a+2;
}
if (a==1)
{
document.getElementById("demo").innerHTML="Hello";
}
else
{
document.getElementById("demo").innerHTML="GoodBye ";
}
</script>
</body>
</html>
|