It sounds like you might have a syntax issue or a misplaced tag, double-check your HTML structure. Answer from Inateptind1955-w905 on reddit.com
AskIT
Loading · Skip to page content
Create a symbolic link in Unix
Loading · Skip to page content
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Learn › HTML › Introduction_to_HTML › Debugging_HTML
Debugging HTML - Learn web development | MDN
These are often harder to fix than syntax errors, as there isn't an error message to direct you to the source of the error. HTML itself doesn't suffer from syntax errors because browsers parse it permissively, meaning that the page still displays even if there are syntax errors in the source code.
🌐
W3Schools
w3schools.com › tags › ref_httpmessages.asp
W3Schools.com
When a browser requests a service from a web server, an error might occur, and the server might return an error code like "404 Not Found". It is common to name these errors HTML error messages.
🌐
CodeBasics
code-basics.com › frontend › html course › errors in html markup
Errors in HTML markup | HTML | CodeBasics
You can provide a link to a page or a fragment of HTML markup, and then the validator will display a list of warnings and errors. In the example above, the validator will show the following errors: No opening <span> tag, but there is a closing </span> tag. This usually means that we either accidentally closed the wrong tag, as in this case, or opened the wrong one. Modern code editors help avoid this error because they automatically close tags when they are created
🌐
Reddit
reddit.com › r/learnprogramming › would someone please explain what these error messages are telling me for this simple html page?
r/learnprogramming on Reddit: Would someone please explain what these error messages are telling me for this simple HTML page?
August 5, 2024 -

I went over the codes numerous times. I tried adding in and then removing the extra slash in the link tags.

What's up with this error message? Isn't my close tag correct?

<!-- Your code here -->

<!DOCTYPE html>

<html lang="en">

<head>

<title>My Site Title</title>

<link rel="stylesheet" type="text/css" href="style.css" />

</head>

<body>

</body>

</html>

Error message:

  1. index.html

valid html

has a valid HTML structure:

AssertionError: invalid HTML:

Expected omitted end tag <link> instead of self-closing element <link/>

Trailing whitespace

: expected false to be true

  • expected - actual

-false

+true

at Context.<anonymous> (test/indexTest.js:103:73)

at process.processImmediate (node:internal/timers:483:21)

🌐
Nestify
nestify.io › blog › common-html-errors-to-avoid-how-to-check-them
Common HTML Errors to Avoid & How to Check Them
January 14, 2025 - These errors are often related to issues with DOM structure, missing or improperly used HTML tags, and broken links. Developer Tools also allow you to inspect specific elements, helping you pinpoint the exact location of errors.
🌐
Codingtag
codingtag.com › some-common-html-errors-you-must-avoid
Some Common HTML Errors you must avoid | HTML Code Tips
The initial line of an HTML code must include the doctype declaration to ensure which HTML version you are using. The syntax which is used to include the doctype declaration in HTML5 is <!DOCTYPE html>. <!DOCTYPE html> <html> <body> <h1>HTML Errors</h1> <p>This is a tutorial of error</p> </body> </html>
🌐
Medium
medium.com › @wewillcode › top-12-common-errors-that-you-encounter-while-using-html-f2909e3b1d48
TOP 12 COMMON ERRORS THAT YOU ENCOUNTER WHILE USING HTML | by Harsh Mehta | Medium
September 27, 2020 - The most common mistakes in HTML are usually just plain human mistakes. Here’s a list of HTML no-no’s: Missing quotation marks for attribute values. ... If any of the lines cross, then you have probably nested improperly.
Top answer
1 of 5
3

Your code is an absolute mess and doesn't follow the proper document structure for an HTML file, which should be:

Copy<!DOCTYPE html>
<html lang="en-us">
<head>
  <meta charset="utf-8">
  <title></title>
</head>
<body>


</body>
</html>

You had multiple <html> tags and tags in the wrong place with content that should not have been in them. For example, your <meta> tag was inside of your <style> element. Other issues I see: you have an <h1> and then jump to <h3>. Where's the <h2>?

So, your file would need to be re-worked to be like this (which does validate):

Copy<!DOCTYPE html>
    <html>
      <head>
         <meta charset="utf-8">
         <title>Ian Morgan Kettell</title>
         <style>
             table {
               border-style: solid;
             }
    
             td {
              border-style: solid; 
              border-color: #FF66FF;
              padding: 10px;
             }
         </style>
       </head>
       <body>
         <h1>Ian's Hobbies! </h1>
         <table>
           <tr>
            <td>Camping</td>
            <td>Hiking</td>
            <td>Cycling</td>
          </tr>
          <tr>
            <td>Fishing</td>
            <td>Kayaking</td>
            <td>Skiing</td>
          </tr>
        </table>
   
        <a href="movies.html">Learn about Ian's Favorite Actors and Movies!</a>
       <h2>My Favorite Movies</h2>
       <ul>
        <li>Promised Land</li>
        <li>Flight</li>
        <li>Taken</li>
       </ul>
      <p>
        The movies I chose were Promised Land starring Matt Damon, Flight
        starring Denzel Washington, and Taken starring Liam Neeson. Even though
        I have an endless list of favorite movies these are by far my top 3. I 
        like them because I like movies I can learn things from. For instance; 
        Promised Land is a film about oil companies fighting to buy land from 
        farmers to frack the land to find oil. It shows both sides of the 
        process of how they convince people and I found it extremely interesting.
     </p>
     <h2>My Favorite Actors</h2>
     <ul>
        <li>Matt Damon</li>
        <li>Denzel Washington</li>
        <li>Liam Neeson</li>
     </ul>
     <p>
        If I had to choose my favorite actors my top 3 would be Matt Damon, 
        Denzel Washington, and Liam Neeson. I think Denzel Washington is my 
        favorite actor of all time. He has been an actor since the year 1981 
        when he made his debut apperance in the comedy A Carbon Copy.He is best 
        known for Philadelphia Man, Man on Fire, The Book Of Eli, American 
        Gangster, and Flight.In recent years he has starred in action movies. 
        Some of my favorite movies he's in are Inside Man, Out of Time and The 
        Book Of Eli, these are all kind of action dramas.
     </p>
    </html>
Run code snippetEdit code snippet Hide Results Copy to answer Expand

2 of 5
1

It's very easy to validate online a HTML DOM structure:

You code has the following issues:

CopyContent Occurs After End Of Body (At line 39, column 1)
Discarding Unexpected <html> (At line 40, column 2)
<meta> Lacks "content" Attribute (At line 41, column 1)
Content Occurs After End Of Body (At line 41, column 1)
<meta> Isn't Allowed In <body> Elements (At line 41, column 1)
Content Occurs After End Of Body (At line 43, column 2)
<title> Isn't Allowed In <body> Elements (At line 43, column 2)
Content Occurs After End Of Body (At line 46, column 2)
Content Occurs After End Of Body (At line 49, column 1)
Content Occurs After End Of Body (At line 60, column 1)
Content Occurs After End Of Body (At line 66, column 1)
Content Occurs After End Of Body (At line 69, column 1)
Content Occurs After End Of Body (At line 80, column 1)
Discarding Unexpected </html> (At line 86, column -3)

You can use several online HTML validator to check this like W3C Markup Validation Service or other tools like this one.

So in your specific case, you have a closing html tag on line 39, that is the first error we can see and the classic

Content Occurs After End Of Body (At line 39, column 1)

and so on. As W3C validator points out, this first error is marked as FATAL, no way to parse the structure over:

CopyFatal Error: Cannot recover after last error. Any further errors will be ignored.
Find elsewhere
🌐
Educative
educative.io › answers › what-are-error-messages-in-html
What are error messages in HTML?
Have you ever encountered a "404 not found" message in response to a query on the browsers? These situations occur when there is a problem with the server-side code, and it sends back a message to the client indicating the presence of the problem.
🌐
Telerik
docs.telerik.com › teststudio › troubleshooting-guide › recording-problems-tg › parsing-error
Resolving Errors Related to Invalid HTML Code - Progress Test Studio
This message indicates that Test Studio has encountered invalid HTML code that can't be correctly parsed. Most web pages contain HTML errors. The majority of these are minor and do not seriously affect the way the page is displayed in a browser or how it is parsed by Test Studio.
🌐
Indiana University
servicenow.iu.edu › kb
Common HTML error codes - IUKB
Following is a list of the most common HTML error codes.
🌐
GeeksforGeeks
geeksforgeeks.org › html › how-to-check-for-errors-in-html
How to check for errors in HTML ? - GeeksforGeeks
October 31, 2021 - In the below example, there are some syntax errors like incomplete p tag, incomplete h1 tag, but still, it displays some of the content in an expected way. In this case, the initial p tag and h1 tag but the next p tag is displayed as h1. These scenarios are easy to identify and avoid in small codes but when the length of code increases, it will be complex to debug code. ... <!DOCTYPE html> <html> <head> <title>HTML errors</title> </head> <body> <h1>HTML errors</h1> <p>unclosed paragraph tag <h1>its displaying the way it is intended <p>but it may lead to next unexpected thing </body> </html>
🌐
freeCodeCamp
forum.freecodecamp.org › html-css
How do I write error messages in HTML5? - HTML-CSS - The freeCodeCamp Forum
May 24, 2021 - In the first error message, it says " * ## 3. I can see a with id=“survey-form.” but I have that written already https://codepen.io/GoodNGo/pen/mdWWYqj beneath the p id · I would suggest switching the Syntax Highlighting on Codepen. It will help catch syntax errors · Go to your Codepen ...
🌐
W3C
validator.w3.org › docs › errors.html
Error Explanations for The W3C Markup Validation Service
Check that you are using a proper ... This error may appear if you forget the last "--" to close one comment, and later open another. ... You have used an illegal character in your text. HTML uses the standard UNICODE Consortium character repertoire, and it leaves undefined (among others) 65 ...
🌐
Taeluf
taeluf.com › blog › html › show-errors
Show errors in html | What tag should i use?
TLDR: Use a <p class="error"> with a message inside the <p>. It is not semantically meaningful, but it is the option used by w3.org on the html5 spec and there is not an option that is explicitly better.
Top answer
1 of 3
5

Problem with your values qty1,qty2,qty3. these values are reading as string. so instead of addding these values , its concatinating the strings. replace

  var qty1 = document.getElementById("Quantity1").value;
  var qty2 = document.getElementById("Quantity2").value;
  var qty3 = document.getElementById("Quantity3").value;

with

  var qty1 = parseInt(document.getElementById("Quantity1").value);
  var qty2 = parseInt(document.getElementById("Quantity2").value);
  var qty3 = parseInt(document.getElementById("Quantity3").value);

It will Solve your problem with 'Red'.

For the submit button, function total() is not returning anything. so change something like

  function total() {

   var p1 = document.getElementById("Price1").value; //Value is referenced to the input tag
   var p2 = document.getElementById("Price2").value;
   var p3 = document.getElementById("Price3").value;
   var qty1 = parseInt(document.getElementById("Quantity1").value);
   var qty2 = parseInt(document.getElementById("Quantity2").value);
   var qty3 = parseInt(document.getElementById("Quantity3").value);
   var over = qty1 + qty2 + qty3;

   if (realNumber()) {
    var totals = (p1 * qty1) + (p2 * qty2) + (p3 * qty3);
    var yes = (totals).toFixed(2);
    document.getElementById("ProductTotal").innerHTML = "$" + yes;
    if (over > 30) {
      document.getElementById("shipping").style.color = "red";
      return true;

    } else if(over>0) {
     document.getElementById("shipping").style.color = "black";
     return true;
    }else{
     document.getElementById("shipping").style.color = "black";
     return false;
    }
 }
 }

and checkout() as

function checkOut() {
  if (total()) {
    if (((document.getElementById("shipping").style.color == "red") &&
         (document.getElementById("extra").checked))||
        (document.getElementById("shipping").style.color != "red")) {

         return true;
    }
  }
  return false;

}
2 of 3
2

Replace

var over = qty1 + qty2 + qty3;

With

var over = parseInt(qty1) + parseInt(qty2) + parseInt(qty3);
🌐
W3Schools
w3schools.com › tags › att_onerror.asp
HTML onerror Attribute
If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail: sales@w3schools.com · If you want to report an error, or if you want to make a suggestion, send us an e-mail: help@w3schools.com · HTML Tutorial CSS Tutorial JavaScript Tutorial How To Tutorial SQL Tutorial Python Tutorial W3.CSS Tutorial Bootstrap Tutorial PHP Tutorial Java Tutorial C++ Tutorial jQuery Tutorial
🌐
SitePoint
sitepoint.com › html & css
HTML error finder - HTML & CSS - SitePoint Forums | Web Development & Design Community
April 27, 2012 - Yes, Dw has a built in validator and highlights invalid code in code view. I find this addon for Firefox useful though. ... I can’t argue with the w3.org validator. It is technology-agnostic and singular of purpose. If I might chip in here, I’ve built a validator on top of validator.nu, which is also what the w3 uses. It’s called http://html.validator.pro.
🌐
C# Corner
c-sharpcorner.com › article › debugging-html-code-common-errors-and-how-to-fix-them
Debugging HTML Code: Common Errors and How to Fix Them
June 13, 2023 - This can cause confusion --> <div ... not able to get it on your webpage. The only reason behind this error is the use of the wrong syntax for links....