在Javascript中添加一次

时间:2012-02-15 23:22:22

标签: javascript append html-lists

我将如何附加以下代码一次:

$('.faq_info').append(
                            '<ul>' +
                            '<li>Highlighted code for double html, body, and head tags means its invalid.</li>' +
                            '<li>Check highlighted iframe tags if it effects link placement.</li>' +
                            '<li>Highlighted charset means its not UTF8 or it is a bad charset.</li>' +
                            '<li>Highlighted symbols means that they are effecting the link.</li>' +
                            '<li>Check highlighted comments if it effects the link placement.</li>' +
                            '<li>If client url is highlighted it means something else in the source is causing it to be invalid.</li>' +
                            '<li>Check to see if client url is in the source code.</li>' +
                            '</ul>'
                        );

1 个答案:

答案 0 :(得分:3)

我刚刚做了以下$('div.faq_info')。empty()。append('whatever string');它的工作原理。它基本上清空div中的任何内容并追加。