I need to update a code by having the name appear in italics in the following sentences.
Where in the innerHTML would I place the tags?
`enter code here`
<html>
<head>
<title>
Greetings
</title>
<meta charset="us-ascii">
</head>
<body>
<h2>Greetings</h2>
<p>
Enter your name:
<input type="text" id="nameBox" size=12 value="">
</p>
<input type="button" value="Click for Greeting"
onclick="
document.getElementById('outputDiv').innerHTML=
'Hello '
+ document.getElementById('nameBox').value
+ ', welcome to my page.<br>Do you mind if I call you '
+ document.getElementById('nameBox').value
+ '?';
">
<hr>
<div id="outputDiv">
</div>
</body>
</html>
I tested the following code, it should make the reply italicized. FYI all changes to the look of the output can be done using CSS (the style tags). Also, it is a good idea to keep HTML, JavaScript, and CSS components isolated from one another.