Answers for "link button to textfield"

0

link button to textfield

const ageInput = document.querySelector('#age-input');
ageInput.valueAsDate = new Date(); 

document.querySelector('#Bt-Submit').onclick = function()
{
  let Age = new Date( new Date() - ageInput.valueAsDate ).getFullYear() - 1970;
  console.log(Age);
  if (  Age < 21 ) { document.location.href = "https://disney.com" }
}
document.querySelector('#Bt-Reset').onclick = function()
{
  ageInput.valueAsDate = new Date(); 
}
Posted by: Guest on October-13-2020

Browse Popular Code Answers by Language