This code displays the button then nothing happens when I click on it. Can someone please tell me why? Thank you in advance for your reply.
<!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>
<title>Displaying Times and Dates</title>
<script type="text/javaScript" Language="javaScript" >
Function getData() {
var now = ""
var localtime1 = ""
var utctime1 = ""
var myButton = document.getElementById("myButton");
now = new Date();
localtime1 = now.Tostring();
utctime1 = now.toGMTString();
alert("<strong>Local Time:<strong> '
+ Localtime1 + '
");
alert("<strong>UTC Time:</strong> " + utctime1);
}
Function test() {
alert("Testing to see if this executed");
}
</script>
</head>
<body>
<h1>Current Date and Time</h1>
<input type="button" id="myButton" value="Get Date" onclick="getData();" />
</body>
</html>