In my JavaScript file, I create a "fake" tag (Like this):

    <self_closing-fake_tag />

These tags generated when the script is called, and not part of the website itself.

(function() {
    // ...
    let e = document.createElement("fake-tag");
    // Refer to the tag...
    e = document.querySelector("fake-tag");
    e.innerHTML = "<self_closing-fake_tag />";
    // ...

Can it harm the SEO of the website?

  • I guess no answers means no, but I decided to stick to the HTML rules and I won't invent my own tags (even though, I must admit, it will make my life easier). Thanks anyways... Apr 17 at 20:27
  • What is the purpose of the fake tags? Have you done testing in lots of browsers? Last time I checked some browsers treated unknown tags differently than others. Apr 18 at 9:23
  • I haven't tested. to me they worked well (and actually the same) in all major browsers (except for Safari which I don't have) but I decided to go with the "better safe than sorry" way until someone will help me to verify that I can use them without worrying about SEO Apr 19 at 10:16
  • @StephenOstermiller The purpose is to insert them before body in order to apply styles to the body which can affect these tags Apr 19 at 10:17
  • For styling you should use <div class=foo> rather than <foo>. Apr 19 at 10:20


Your Answer

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

Browse other questions tagged or ask your own question.