Skip to content

Instantly share code, notes, and snippets.

@mohammad-hammal mohammad-hammal/index.js
Last active Oct 30, 2018

Embed
What would you like to do?
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
You can’t perform that action at this time.