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.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.