我试图使用jQuery选择器向DOM添加一些内容,但我想在添加之前对其进行操作.
var $content = $('<h1>title</h1><h2 id="xx">remove me</h2><p>some content or other</p>');
$content.remove('#xx');
$('#output').append($content);
Run Code Online (Sandbox Code Playgroud)
我把它放在jsfiddle这里http://jsfiddle.net/NNcG5/1/
非常感谢,迈克
| 归档时间: |
|
| 查看次数: |
148 次 |
| 最近记录: |