Message with Name
Enter your name and receive a message.
by Carin Camen
HTML
<body>
<header>
<div id="title">
<p>Displaying a message with your name.</p>
</div>
</header>
<content>
<!--<div id="button_enter">
<button onclick="myFunction()">Click to enter name.</button>
</div>
<div id="button_solve">
<button onclick="myFunction()">Click to see message.</button>
</div>-->
<script>
var hello_text = "Hello";
var close_text = "It's good to meet you!";
var first_name = prompt("Please enter your first name", "First Name");
var last_name = prompt("Please enter your last name", "Last Name");
var full_name = " " + first_name + " " + last_name + "." + " ";
var output = "<h1>" + hello_text + full_name + close_text + "</h1>";
document.write(output);
</script>
</content>
</body>
JavaScript
(function() {
var wf = document.createElement('script');
wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +
'://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
wf.type = 'text/javascript';
wf.async = 'true';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(wf, s);
})();