1

I am building a image slider with custom html elements. It is supported by the most of browsers but there is also an library for those that doesn't "document-register-element.js"

It works as expected.

The question i have is, is this is valid?

For example i have this custom element in HTML <cp-slider></cp-slides>

In the javascript it is registered as an HTML Element document.registerElement('cp-slider', {prototype: proto});

Here https://validator.w3.org/ it shows is as an error. But it doesn't check the JS of the file. So should i avoid custom DOM elements? Or in the "real validation (by google perhaps for SEO)" it wont be an issue?

Thank you!

2
  • Possible duplicate of Are custom elements valid HTML5? Commented Jun 20, 2016 at 13:20
  • (That's a very old question, but the marked-correct answer is still correct.) Commented Jun 20, 2016 at 13:21

1 Answer 1

1

It's bound to show an error in the validation site because it is likely only checking the standard HTML syntax. You shouldn't necessarily avoid custom DOM elements, they're very useful in some cases. The framework AngularJS allows you to smoothly define such custom elements (known as directives). This may or may not affect your SEO, depending on what is hidden. Google supposedly can infer some details, but you'll have to see what happens in your particular case.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.