I'm very new to using Javascript and I want to display this variable on my homepage for my portfolio
<html lang="en">
<head>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script>
var curDate = new Date();
var curYear = curDate.getUTCFullYear(),
curMonth = curDate.getUTCMonth(),
curDay = curDate.getUTCDate();
var myYear = 1996,
myMonth = 10,
myDay = 22;
var myAge = curYear % myYear;
if (curMonth < myMonth && curDay < myDay || curMonth < myMonth && curDay === myDay || curMonth == myMonth && curDay < myDay) {
myAge -= 1;
}
var myAgeDiv = document.getElementById('my-age');
myAgeDiv.textContent = myAge;
$('#my-age').text(myAge);
</script>
<title>My eportfolio!</title>
</head>
<body>
<div id="my-age"></div>
</body>
</html>
Edit: I've created a new html file (the same as above) with no other content external .js files and it still doesn't work. Does this mean the age displaying code is wrong?