Reapply style after adding content with JavaScript

后端 未结 1 566
南方客
南方客 2021-01-27 00:44

I will try to expand my problem:

I have a link:

Display

I have some

相关标签:
1条回答
  • 2021-01-27 01:23

    That's the problem was talking about in my comment. You are calling document.write(MyHtml) after the document was fully loaded.

    It will completely replace the document (see the documentation). Inspect it, you will see that there is an empty head (also see this and this example).

    Use other methods to manipulate the DOM.

    0 讨论(0)
提交回复
热议问题