Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

My question is regarding the <h2> tags used. Did I use them correctly? Is this c

ID: 3624558 • Letter: M

Question

My question is regarding the <h2> tags used. Did I use them correctly?
Is this code correct overall?

<html>

<head>
<title>HW#8</title>
</head>

<body>

<h2>

<script type="text/javascript">

typeObject = prompt("Choose any object:", "");
typeAction = prompt("Type of action:", "");
typePlace = prompt("Name a place (school, church, house etc.):", "");
typeFeeling = prompt("A Kind of emotion:", "");

document.write("<p> My friend has a " + typeObject + " that she uses to " + typeAction + " at " + typePlace + ". It makes me very " + typeFeeling + ".</p>");
</script>

</h2>

</body>

</html>

Explanation / Answer

The H2 element by default is a 'block' element therefor, by default, it will span the whole page and disallow anything to be on the same line as it. Your javascript seems to perform exactly as intended so no problem there.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Chat Now And Get Quote