Last active
October 30, 2018 06:31
-
-
Save mohammad-hammal/7434a177e428ab0c2ca2ba0a7fc1b2fe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var $ = require('jquery'); | |
var calculator = require('./calculator'); | |
$(function(){ | |
$('form').on('submit', function(event) { | |
event.preventDefault(); | |
var dateValue = $('.date-input').val(); | |
if (!dateValue) { | |
alert('Please enter valid value'); | |
return; | |
} | |
var age = calculator.getAge(dateValue); | |
alert(age); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment