ashgawlik.com/js/javascript.js

25 lines
625 B
JavaScript
Raw Normal View History

2024-09-11 14:24:00 +00:00
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
}