Issue while setting html of div using the jquery html() method

后端 未结 5 876
庸人自扰
庸人自扰 2021-01-27 19:57

I\'ve got an issue with jquery where I set the html of a div using the html method, but it does not set it correctly.

Here\'s the stripped down code I\'m using:

5条回答
  •  面向向阳花
    2021-01-27 20:43

    1. The HTML you are trying to generate is invalid (this is your primary problem). Since you are using XHTML, the rules for quoting attributes are simple: attribute values must be quoted. Yours are not.
    2. You are using JavaScript: pseudo URIs
    3. You are using invalid XHTML
    4. You are not using HTML-Compatible XHTML

提交回复
热议问题