Firstly, the line that renders "<h2>Hello <h4> name </h4>..." is not syntactically correct, it should be something like this:
document.write("<h2>Hello <h4> " + name + " </h4>, and welcome to my webpage.</h2>");
Lastly, if you want to change how the em tag look, you can do this by adding some rules to your style sheet, as follows:
document.write("<h2>Hello <em> " + name + " </em>, and welcome to my webpage.</h2>");
The code above applies the style to every single em that sits under an h2, so you might want to change it a little to suit your needs.
color: Blue; /* make the text blue, this is just an example */