ballingtonma
12-17-2003, 11:45 AM
Hi, I require a script that will enable me to enter the date of birth in the body of the page, and the script in the head so that it will take the date of birth and change it in to an age. I will require multiple peoples ages on the page. I know what I have done as an example is totally wrong, but it will give you an idea of what i require.
<html>
<head>
<script language="JavaScript">
<!-- Begin
function age(day,month,year) {
document.write( day=" + day + ",month=" + month + ",year=" + year + " );
}
// End -->
</script>
</head>
<body>
<!-- Daves Profile -->
<b>DAVE</b>
Age:
<script language="JavaScript">
document.write(21,11,1986);
</script>
<br><br>
<!-- Johns Profile -->
<b>JOHN</b>
Age:
<script language="JavaScript">
document.write(02,10,1984);
</script>
</body>
</html>
For e.g. They would then appear like this:
DAVE
Age: 17
JOHN
Age: 19
Thanks In Advance,
Matt
<html>
<head>
<script language="JavaScript">
<!-- Begin
function age(day,month,year) {
document.write( day=" + day + ",month=" + month + ",year=" + year + " );
}
// End -->
</script>
</head>
<body>
<!-- Daves Profile -->
<b>DAVE</b>
Age:
<script language="JavaScript">
document.write(21,11,1986);
</script>
<br><br>
<!-- Johns Profile -->
<b>JOHN</b>
Age:
<script language="JavaScript">
document.write(02,10,1984);
</script>
</body>
</html>
For e.g. They would then appear like this:
DAVE
Age: 17
JOHN
Age: 19
Thanks In Advance,
Matt
