In a simple webpage, I am trying to grab the value of an input field as it's being typed and display it simultaneously within the context of code.
So a user could past an URL into the input field and it immediately update the code displayed, so he can easily copy the update code. For example:
<input type='text' name='typedURL'>
Here is your code: <a href="value of typedURL">copy this</a>
I searched all over the internet and am under the impression that the best solution is using this:
<form onsubmit="return false" onkeyup="o.value = a.value">
<input name="a" id="a" type="text" step="any">
<br>
Here is your code:
<code>
<a href="<output name="o" for="a b"></output>">Copy this code</a>
</form>
But I can't get it to output the value PLUS the surrounding code.