W3C HTML Validator: Attribute ~ not allowed on element ~ at this point

This error seems like to say “you don’t set the attribute correctly”. In other words, I thought the element has the attribute at least. However, I couldn’t find this attribute on the element page in MDN. When I see this error, is there a possibility the element doesn’t have the attribute? Or, what kind of attributes has a possibility they are not written on the element page?

Hi @user-p

What element and attribute are we talking about? It’s hard to give a general answer without knowing the details.
There are global attributes that aren’t listed on every element page. But those attributes should always be allowed, just not listed.

Cheers,
Michael

2 Likes

Hello @mikoMK, I appreciate your reply.
I looked over “From object to iframe (The <embed> and <object> elements)” of both the English and the Japanese. Only in the latter, I saw typemustmatch as an attribute of the object element.

<object data="mypdf.pdf" type="application/pdf"
        width="800" height="1200" typemustmatch>

At least, this translation didn’t look old*. However, I couldn’t find the attribute on the element page, the global attributes page, and " The 26 Boolean Attributes of HTML".
I also found the attribute in the HTMLObjectElement page of the same language, but I couldn’t find it on the English version. This translation also didn’t look old*. typemustmatch in the translation has a link to the object element page of the same language (object#attr-typemustmatch), but I couldn’t find the attribute in the page*.

*All the translations I checked showed “Last modified: March 12, 2022”.

こんにちは @user-p
Thank you very much for the example! It helped me digging for the right answer. :slightly_smiling_face:

The error message

This error is indeed a bit misleading. It can also mean: “Not allowed at all”. You can test this by using an arbitrary name on an element like <p notRealAtAll></p>. This gives the same error message. The reason for this ambiguous error message are the inner workings of the validator. One of the creators of the validator explains the reason in this comment.

Attribute “typemustmatch”

This attribute was removed in 2019 from the specification since it wasn’t implemented much by most browsers and introduced a small information leak. Therefore the English article is correct and the attribute should be removed from the note in the Japanese version.

Have a nice day,
Michael

1 Like

Hi @mikoMK,
I appreciate your explanation and helpful links. I was able to understand the error.

what kind of attributes has a possibility they are not written on the element page?

You mean the element page doesn’t include old atttribute?

Therefore the English article is correct and the attribute should be removed from the note in the Japanese version.

Is there no page I can check the attributes which have already been removed?

1 Like

Of course I wanted to understand the error as the goal, so I really appreciate your message. That was very helpful. However, my question of this topic wasn’t clear. I wanted to solve mainly something like the new question. As a one of possibilities, I was also thinking about old attribute, but I couldn’t find info to solve the question. I created this topic, because I was suffering from such things mainly.

1 Like

Mostly, such attributes are deprecated. Which means they shouldn’t be used in new projects but are still supported in browsers. Therefore you will still find the documentation on MDN. See <body> as an example. All attributes with a trash can after the name are deprecated. Browsers still support them but there are better ways of doing it.
Normally old stuff doesn’t get removed from browser, because nobody wants older pages to suddenly break. The typemustmatch attribute is a bit of a special case. It was only ever implemented in Firefox and after the information leak was found it was completely removed from the browser.

I don’t think there is something like this, but as said above that is a very rare case. Normally something is deprecated but still implemented and therefore documented.

If you see an attribute somewhere that isn’t documented on MDN you could search the MDN GitHub repo to see if there are any traces from its removal. (This is only possible for changes since December 2020 when MDN moved to GitHub). For example, when searching for “typemustmatch” you can find a PR which removes the Web API article. There isn’t any PR which removes the attribute from the <object> article, because that happened before the GitHub migration.

I hope that makes things clearer and not more complicated. :slightly_smiling_face:

1 Like

I appreciate your help. Your reply definitely made things clearer.

I’m always impressed with your message. There is not only the minimum, but also enough explanation and information for exactly what I lack. In addition, there’s no waste, it is clean. I know my post isn’t like your post. My “thanks” may continue to be simple, but I am so grateful for you.

1 Like

Thank you for the kind words. It means a lot to me. :blush:

I always try to give good and clean answers. Sometimes it works and sometimes it doesn’t. That’s why it’s always fine to tell me were I went wrong and I try to improve. In the end, I’m also learning a lot by investigating certain questions. For me personally, this is one of the fun and valuable parts of helping other.

1 Like

I appreciate telling me what you think. I’ll also keep trying to write easier to understand and cleaner post.

1 Like