简体   繁体   中英

How can I remove div have id or attributes by HTML Purifier

I have a content like

<div class="block-related" data-component-type="link" id="block-related-link">
    <ul>
        <li>Test</li>
    </ul>
</div>
<div class="block-related" data-component-type="topic" id="block-related-topic">
    <ul>
        <li>Test</li>
    </ul>
</div>

How can I remove div by using HTML Prurifier (fitler by id or attribute data-component-type)

Sorry for my bad English

Thanks !!!!

Do you mean this ?

http://jsfiddle.net/VdCtq/

$('#rm_id').click(function () {
    $('#block-related-link').remove();
});

$('#rm_attr').click(function () {
    $('div[data-component-type="topic"]').remove();
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM