ashgawlik.com/js/javascript.js
2024-09-11 15:24:00 +01:00

25 lines
625 B
JavaScript

const birthday = new Date(2007, 1, 26);
// update age function (copied from old age.js file)
function updateAge() {
const now = new Date();
const difference = now - birthday;
const ageInYears = difference / 1000 / 60 / 60 / 24 / 365;
const ageElement = document.getElementById("age");
ageElement.innerText = ageInYears.toFixed(7);
setTimeout(updateAge, 100);
}
console.log(":)");
updateAge();
function validateForm() {
let x = document.forms["myForm"][fName].value;
if (x==""){
alert("You must enter a name ");
return false;
}
}
function myFunction() {
let x = doc
}