GitHub Pages URL parameters

I have an input in a HTML page(). The form should redirects to another URL with a url parameter that is equal to the input. The URL would look like this:
user.github.io/repository?color=red
How could I do that?
Thank you in advance!

Hello @Galaxy-Coding, it depends on the form.

With HTML you can do:

<form>
  <input type="text" name="color" value="red"><br>
  <input type="submit" value="Submit">
</form> 

If sending to a new page, you can add the action attribute to <form>. (e.g. action=“my_url”)

or with JavaScript:

<form id="myForm">
  <input type="text" name="color" value="red"><br>
  <input type="submit" value="Submit">
</form> 
<script>
document.getElementById('myForm').onsubmit = function () {
  // set params using form values
  window.location.search = this.color.name + '=' + this.color.value;
  
  // prevents normal form submission
  return false;
};
</script>

If you’re setting the whole URL, you can use location.href instead and append your params.