I have limited coding experience, so please forgive me if this is a simple question.
I am curious if it is possible to create a feature on a website where user input is utilized elsewhere. Specifically, I am looking to have an input box where a user enters their name, and that name is then displayed in place of a designated "name" variable. For example, if someone enters the name "Alice", the text "Hello (name)" would show up as "Hello Alice".
I have not come across any resources that explain how to achieve this, which has left me wondering if it is even feasible.
My current focus has been on setting up the input box, and so far I have this code:
<body>
<form>
<label for="namebox">Name:</label>
<br>
<input type="text" id="uname" name="name" value="Namehere">
<br>
<button>Submit</button>
</form>
<p id="namebox"></p>
<script>
document.getElementById("namebox").innerHTML = "uname";
</script>
</body>
Currently, the output of this script is directing to a non-existent page with the URL ending in "/?name=(whatever name value is inputted)".
If this concept does work, I am curious if the change to the "name" variable would only take place on the page with the input form, or if it would apply across all pages on the site.
I appreciate any assistance on this matter.