©
Ce document utiliseManuel du site Web PHP chinoisLibérer
用匹配的元素替换掉所有 selector匹配到的元素。
在jQuery 1.3.2中,appendTo, prependTo, insertBefore, insertAfter, 和 replaceAll这个几个方法成为一个破坏性操作,要选择先前选中的元素,需要使用end()方法,参见 appendTo 方法的例二。
用于查找所要被替换的元素
把所有的段落标记替换成加粗标记
Hello
cruel
World
$("Paragraph. ").replaceAll("p");
Paragraph. Paragraph. Paragraph.