Here's my take on it. I needed to create a URL by collecting the value from a text box , when the user presses a Submit button.
<html>_x000D_
<body>_x000D_
_x000D_
Hi everyone_x000D_
_x000D_
<p id="result"></p>_x000D_
_x000D_
<textarea cols="40" id="SearchText" rows="2"></textarea>_x000D_
_x000D_
<button onclick="myFunction()" type="button">Submit!</button>_x000D_
_x000D_
<script>_x000D_
function myFunction() {_x000D_
var result = document.getElementById("SearchText").value;_x000D_
document.getElementById("result").innerHTML = result;_x000D_
document.getElementById("abc").href="http://arindam31.pythonanywhere.com/hello/" + result;_x000D_
} _x000D_
</script>_x000D_
_x000D_
_x000D_
<a href="#" id="abc">abc</a>_x000D_
_x000D_
</body>_x000D_
<html>
_x000D_