how to get the text in a box?

You can do this using document.location.href.

let btn = document.querySelector('button');
let ipt = document.querySelector('input[type=text]');

btn.onclick = function() {
  document.location.href = "https://mysitename.com/" + ipt.value;
}
<input type="text" placeholder="link name">
<button>go</button>

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top