I'm trying to get to work a page that says the date with a "index.html" including a javascript file. However, I don't know if I'm missing something here but when testing it, it won't appear in the index.html. I just want the date to be shown with the code of the js. Here's the code of the index.html:
<!DOCTYPE html>
<head>
<title>Test</title>
<meta charset="utf-8">
<script type="text/javascript" src="scripts/date.js"></script>
</head>
<script>
<p id="test1"></p>
</script>
And here's the code of the javascript file:
var isDate = new Date();
document.getElementById("test1").innerHTML = isDate.getDate;
As you can see, I tried puting script tag around the p tag and dindn't work either.
This is really basic javascript but it's like really hard for me to start off in a new language. Thanks.