Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

age validation jquery

var day = 12;
var month = 12;
var year = 2006;
var age = 18;
var setDate = new Date(year + age, month - 1, day);
var currdate = new Date();

if (currdate >= setDate) {
  // you are above 18
  alert("above 18");
} else {
  alert("below 18");
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: angular object sort by key 
Javascript :: how to add two times in javascript 
Javascript :: generate unique random number in javascript 
Javascript :: javascript array iteration methods 
Javascript :: execute shell command in javascript 
Javascript :: updating an array of object in mongoose 
Javascript :: removing duplicates from array javascript 
Javascript :: form an array from i to j javascript 
Javascript :: use jquery in project using NPM 
Javascript :: javascript querySelector change input value 
Javascript :: Make Floating label TextInput in react native 
Javascript :: js tostring 
Javascript :: mongoose in nodem js 
Javascript :: passing multiple props to child component in react 
Javascript :: create video playlist using jquery 
Javascript :: scroll up own 
Javascript :: update object in array state react 
Javascript :: You need to inject a global window.jQuery first. 
Javascript :: how to use mui 
Javascript :: case insensitive string comparison in javascript 
Javascript :: javascript remove function from object 
Javascript :: array==null array.length java script 
Javascript :: redirect to dashboard after login in vue 
Javascript :: make a function and return the index of specific character in javascript 
Javascript :: syntax of reduce in js 
Javascript :: is checked jquery not working 
Javascript :: Redirect user when JavaScript is disabled with noscript 
Javascript :: open file method in node js 
Javascript :: mongoose find in array 
Javascript :: gettwofactorauthenticationuserasync returns null 
ADD CONTENT
Topic
Content
Source link
Name
5+7 =