AllisonC
AllisonC

Reputation: 3099

In Firefox, getting error in console "XML Parsing Error: mismatched tag" for input

I am getting the following error when opening up my page in Firefox (other browsers don't show this error). I am using HTML5 and if I try to put closing tags on the input, then the page fails validation.

enter image description here

<!DOCTYPE html>

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" >
    <!--... more here...-->
  </head>
  <body>
    <!--... more here...-->
    <input type="text" id="wall_color_picker" onclick="startColorPicker(this)" title="Wall Color" value="#FFFFFF">
    <!--... more here...-->
  </body>
</html>

Edit 1: Firefox version is latest (59.0.2 (64-bit))

Edit 2: Response headers:

Cache-Control   max-age=604800, public
Connection  Keep-Alive
Content-Type    text/html; charset=UTF-8
Date    Tue, 24 Apr 2018 16:04:19 GMT
Keep-Alive  timeout=5, max=100
Server  Apache/2.4.6 (Red Hat Enterpri…penSSL/1.0.2k-fips PHP/5.6.35
Strict-Transport-Security   max-age=31536000; includeSubdomains;
Transfer-Encoding    chunked
X-Powered-By    PHP/5.6.35

Upvotes: 7

Views: 2467

Answers (3)

Keno
Keno

Reputation: 2098

TL;DR Your browser is reading your html in an older format

EDIT:

I'd like you to try two more things

  1. In Firefox, select View Page Info from the context menu, and look for Render Mode.

  2. Update to Firefox beta 60 Help -> About Firefox -> Update


It would seem that your browser is reading your code in the XHTML format which requires strict tags among other things. Ensure that your firefox is up to date, and also replace this line:

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

with this:

<meta charset="utf-8">

Reason:

This is another element that’s been simplified since XHTML and HTML4, and is an optional feature, but recommended. In the past, you may have written it like this

Upvotes: 1

S. M. Mohiuddin
S. M. Mohiuddin

Reputation: 388

It seems the Firefox version issue. I have tried that code snippet in Firefox 43.0.1 and found OK. You can please update the Firefox version.

Upvotes: 1

pool pro
pool pro

Reputation: 2114

Because your <input>has no content allot of times people do not close the tag <input></input> but in your case close it at the end of it like so <input type="text" id="wall_color_picker" onclick="startColorPicker(this)" title="Wall Color" value="#FFFFFF"/>

Please try the following,

    <!DOCTYPE html>

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" >
    <!--... more here...-->
  </head>
  <body>
    <!--... more here...-->
    <input type="text" id="wall_color_picker" onclick="startColorPicker(this)" title="Wall Color" value="#FFFFFF"/>
    <!--... more here...-->
  </body>
</html>

Hope this helps

Upvotes: 1

Related Questions