Answers for "link button to input"

29

html button link

<button><a href='https://google.com' alt='Broken Link'>This is a button</a></button>
Posted by: Guest on February-02-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