Simple question.
I'm newbie on javascript and html.
I have a file index.html like:
<html>
<head>
<link rel=StyleSheet href="beauty.css" type="text/css">
<script src="myjs.js"></script>
</head>
<body>
<p id="foo"></p>
</body>
</html>
and this is my js file:
var d=new Date();
var month = d.getMonth()+1;
var data = d.getDate() + "/" + month + "/" + d.getFullYear();
function showdata(){
return data;
}
document.getElementById("foo").innerHTML=showdata();
I understand that I need to reference the html, but I do not have idea how to do that.
reference the html? That could mean a lot of different things...