I'm very inexperienced so I'm sorry if this is a stupid question.
I was wondering if it's at all possible to code something on a site that takes an input and "uses" it elsewhere - what I'm going for is an input box that asks for a name, and the name given will appear in place of some sort of "name" variable. For example, if you entered your name as "Bob", something like "Hello (name)" would appear as "Hello Bob".
I haven't really seen anything that gives instruction on how to do this, which makes me wonder if it's even possible.
I've been trying to handle the input box itself, and so far it looks like this:
<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>
The output of this currently is being sent to a nonexistent page ending in "/?name=(whatever name value is inputted)".
Also, if this does work, would the change to the "name" variable only occur on the page with the input form, or would it carry to all pages on the site?
Thank you for any help.
Your name is [however the "name" variable would be written]
``` would display as "Your name is [the name given in the input box]. – froghaver Sep 09 '19 at 18:07