Calc the age in a box | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Calc the age in a box

please help me to calc the age of a person by clicking a box contains the number(age) and {onclcik) return the value to a script to which will {alert} {DateOfBirth} thanks

9th Dec 2016, 7:28 AM
Whisper in silence
5 Answers
+ 2
you can give I'd to a input and a button should contain the onclick
9th Dec 2016, 5:05 PM
Sun
Sun - avatar
+ 2
try this <input type ="text" Id="text"/> <button onclick="x()">DateOfBirth</button> <script> function x(){alert(document.getElementById("text").value)}</script>
10th Dec 2016, 1:51 AM
Sun
Sun - avatar
0
Ok <html> <body> <script> var x = smthn; </script> <input type="button", value="DateOfBirth", onclick="x();"> <body> </HTML>
9th Dec 2016, 8:31 PM
Whisper in silence
0
what I really need is the script that will return the value of the input and say the dob
9th Dec 2016, 8:33 PM
Whisper in silence
0
I'll try thanks so much Sun
10th Dec 2016, 5:34 AM
Whisper in silence