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

后端 未结 5 866
庸人自扰
庸人自扰 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

    You forgot to quote your href attribute.

    Therefore, it stopped parsing the href's value after the first space.

    You need to write the following:

    $('#results').html(
    ""
    );
    

    The \" creates a " inside a double-quoted string.

提交回复
热议问题