Answers for "input type button as a link"

1

a link button

<input type="button" onclick="location.href='https://google.com';" value="Go to Google" />
Posted by: Guest on December-27-2020
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