Simple JavaScript.
var userName = prompt ("What's your name?");
document.write ("Hello " + userName + ".");
Is there an alternative way to get the user's input (name) than through a pop up box? How would I go about implementing a text box within the site to obtain the user's name?
How is this?
<section class="content">
<input id="name" type="text">
<button onclick="userName()">Submit</button>
<p id="user"></p>
<script>
function userName() {
var name = document.getElementById("name").value;
user.innerHTML = "Hello" + " " + name}
</script>
</section>