-1

I want to make a javascript that will redirect to the url that will be generated by adding the input provided in form and the main url.

For example , If the user puts 'Hello' inside the textbox Then it should redirect it to 'https://example.domain/Hello' And if he puts Bye then it should redirect it to 'https://example.domain/Bye'

1
  • I am not getting what do you mean by first part of the input? Commented May 16, 2022 at 7:27

1 Answer 1

0

You can simply grab the value of the textinput and append it to your baseurl

const inputBox = document.getElementById("input");
let newURL = 'https://example.domain/' + inputBox.value;
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.