Answers for "make input button a link"

4

html button with link

<a href="https://www.google.com">
  <button>Go to Google</button>
</a>
Posted by: Guest on October-01-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