-1
での追加は:は、私は一度、次のコードを追加しに行くかどう一度のJavascript
$('.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>'
);
クラス '.faq_info' ... –
を持つすべての要素に1回追加しています。selectorはnodeListを返します。これは' append() 'メソッドに渡され、' append() 'メソッドを適用します。 *そのnodeList内のすべての* DOMノード。特定の要素にのみ追加するには、クラス名だけではなく、より具体的なセレクターを使用する必要があります。 –
@DavidThomas - jQueryはNodeListを返しません。 '.getElementsByClassName()'は_live_ NodeListを返すことになっていますが、jQueryは間違いなく、一致するすべての要素を含む(参照する)jQueryオブジェクトを返します。 (もちろん、 '.append()'がすべての一致する要素に追加されます)。 – nnnnnn