When a student asks an AI to "Build a website with a 5px border and three sections," they think they are getting a blueprint.
In reality, they are getting a statistical prediction.
Because AI cannot say "I don't know" to a question, it "hallucinates" ...When helping to create HTML, it creates a dangerous situation where the code looks professional and correct but is technically broken for various reasons you will see below....
Looking at the reserach above, ChatGPT is known to hallucinate over 50% of the time...Here is how it can / will hallucinate when asking to create code:
1. Inventing Fake Tags
The most common HTML hallucination is the creation of tags that don't exist.
The Hallucination: The AI might tell a student to use <container> or <column> because those words make sense in English.
The Confusion: HTML doesn't have those tags (it uses <div>). The student's site won't break immediately, but the styles won't apply, and the student will spend hours trying to fix a "border" on a tag that the browser doesn't even recognize.
2. "Franken-Code" (Mixing Languages)
AI sometimes forgets which "language" it is speaking.
The Hallucination: It might suggest putting CSS properties directly into the HTML tag like this: <div border="5px solid">.
The Confusion: This looks logical to a beginner, but it's invalid HTML5. When the border doesn't show up, the student blames themselves or their browser, not the AI "employee" who gave them bad instructions.
3. Confident Incorrectness (The "Expert" Trap)
Because AI is trained on the entire internet, it often pulls from outdated tutorials (from 2005) or experimental code (that only works in one browser).
The Hallucination: It might tell a student to use the <center> tag or <font> tag—both of which have been "deprecated" (retired) for years.
The Confusion: The student learns "bad habits" that will make them fail a modern certification or a more advanced coding class later on.
4. Logic Loops in Debugging
If a student asks, "Why isn't my 5px border showing up?" and the AI has already hallucinated the cause, it will often double down.
The Hallucination: It might tell the student they need a "Special JavaScript library" to see borders, making the project 10x more complicated than it needs to be.
The Confusion: The student ends up with a "bloated" file full of code they don't understand, which is exactly how they get caught "not coding line-by-line."
🛠️ The "Boss" Solution: The 3-Step Verification
If you are getting answers you know / feel are not correct, ask AI these questions to help figure out if it is telling the truth or hallucinating.
The "W3Schools" Check: If the AI gives you a tag you've never seen, look it up on W3Schools. If it’s not there, the AI is lying.
The "Why" Question: Ask the AI: "Why did you use that specific tag instead of a <div>?" If it can't explain it simply, it’s probably a hallucination.
One Tag at a Time: Never copy a whole block. If you add one tag and the site breaks, you know exactly where the "employee" messed up.