BirthYear App
Last updated
Last updated
The app will calculate a user's birthyear and display it after he/she entered his/her name and age.
Import BirthYear App to your Monaca Account
Tested Environment
Android 11.0
iOS 14.3
File | Description |
| The startup Page |
| The stylesheet used in the application |
jQuery
The following contents of the HTML body of index.html
file is for displaying 2 textboxes for the user to input his/her name and age, and a button to calculate his/her birthyear.
This code creates a function called calculate
.
After entering your age and name, it stores them in two variables called myname
and myage
respectively. It then goes on to calculate your birth year based on today's date, and stores it in a variable called birthyear
.
Finally it stores the message contents in a variable called text
, calls the navigator.notification.alert
function and displays the result as a popup.
The navigator.notification.alert
function is a Core Cordova Plugins function that displays a popup dialog box on the screen. The third argument displays the text Welcome to Monaca!
as the title of the dialog box.