我已经在这条线上苦苦挣扎了一个小时,所以我决定问一下。
$('.tempc').html($('.tempc').html() + '<img src="images/wheather/3.png" width="139" height="50"/></br>');
我无法让 html
将图像标签注入(inject)到 div
中。
<div class="tempc"></div>
最佳答案
尝试使用append
:
$('.tempc').append($('<img src="images/wheather/3.png" width="139" height="50"/><br/>'));
关于javascript - 如何通过html()发送图像标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8532583/