2

I know requiring javascript on a webpage has been a hot topic the last couple years.

I'm wondering if someone wanted to use custom elements but still allow the website to be usable without javascript how would they do that?

Would they have to add a <noscript> with regular elements? or is there some way for browsers to know what to fall back to if a custom element is used but javascript isn't enabled?

  • What are you trying to accomplish? Are you trying to figure out what happens to your tags with JavaScript disabled? – svidgen Oct 26 '16 at 23:34
  • I'm wondering what the best practice would be for someone who wants to use the new web components standard and still provide a usable experience for people who don't want to use javascript – Tony Brix Oct 27 '16 at 4:14
  • The answer to most questions along the line “I want to do fancy stuff with JS but only as progressive enhancement” is “server-side rendering”. – amon Oct 27 '16 at 8:22
  • 1
    This question should be asked at stackoverflow.com – TheCatWhisperer Jun 9 '17 at 14:57
  • 1
    @TheCatWhisperer The top two tags on this site are "java" and "c#" I can almost guarantee none of those questions are language agnostic. Is there somewhere on this site that explains what a good/bad question for this site is? – Tony Brix Jun 14 '17 at 21:31
1

Unfortunately, custom elements were not designed to be created with html-only syntax1. They were created with the idea to change the DOM on the fly and add your own elements by javascript only.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.