Forum
24
bd

















1. First of all registration here 2. Then Click on Be a trainer or writer button 3. Collect your trainer or writer id card from trainer master 4. And create post here for earn money! 5. For trainer 100 tk minimum withdraw 6. For writer 500 tk minimum withdraw 7. Payment method Bkash Only
obaydulbc obaydulbc
Trainer

2 years ago
obaydulbc

javascript Age calculator for wapka



javascript age calculator like this




Login your wapka site >> create new page >> name this page ( Age calculator) >> than goto this page >> click on new code
>> past this code and save it


<html>
<head>
<script>
function ageCalculator() {


var userinput = document.getElementById("DOB").value;


var dob = new Date(userinput);


if(userinput==null || userinput=='') {



document.getElementById("message").innerHTML = "**Choose a date please!";




return false;


} else {





//calculate month difference from current date in time


var month_diff = Date.now() - dob.getTime();





//convert the calculated difference in date format


var age_dt = new Date(month_diff);





//extract year from date




var year = age_dt.getUTCFullYear();





//now calculate the age of the user


var age = Math.abs(year - 1970);





//display the calculated age


return document.getElementById("result").innerHTML =







"Age is: " + age + " years. ";


}
}
</script>
</head>
<body>
<center>
<h2 style="color: 32A80F" align="center"> Calculate Age from Date of Birth <br> <br> </h2>

<!-- Choose a date and enter in input field -->
<b> Enter Date of Birth: <input type=date id = DOB> </b>
<span id = "message" style="color:red"> </span> <br><br>


<!-- Choose a date and enter in input field -->
<button type="submit" onclick = "ageCalculator()"> Calculate age </button> <br><br>
<h3 style="color:32A80F" id="result" align="center"></h3>
</center>
</body>
</html>





thank you so much stay with us


×

Alert message goes here

Plp file


Category
Utube fair

pixelLab দিয়ে নিজের নাম ডিজাইন ও Mocup

Paid hack

App link topup