0

I'm trying to make grease monkey script that could remove certain lines in html

like this for example

<ul class="actionList" id="actionList" style="height: 158px;">
    <li class="actionListItem minion minion-0 first">
        <div class="header">
            <div class="verbs">
                <a data-tipped="Look at the XXX" class="view verb tip-static" href="#"></a>
                <a title="Attack XXX" href="#" class="verb attack attack-1 action-attack-minion-2442 default"></a></div>
            <a data-tipped="minion" data-name="XXX" class="icon tip-static" href="#"></a>XXX</div></li>
    <li class="actionListItem minion minion-0">
        <div class="header">
            <div class="verbs">
                <a data-tipped="Look at XXX" class="view verb tip-static" href="#"></a>
                <a title="Attack XXX" href="#" class="verb attack attack-2 action-attack-minion-2442 default"></a></div>
            <a data-tipped="minion" data-name="XXX" class="icon tip-static" href="#"></a>XXX</div></li>
    <li class="actionListItem Minion Minion-0 last">
    <div class="header"><div class="verbs"><a data-tipped="Look at the XXX" class="view verb tip-static" href="#"></a><a title="Attack XXX" href="#" class="verb attack attack-3 action-attack-Minion-2442 default"></a></div><a data-tipped="Minion" data-name="XXX" class="icon tip-static" href="#"></a>XXX</div></li></ul>

I want to remove

tried something like this

$('li:contains("actionListItem minion minion-0")').parent().remove();

I'm still new in scripting its not working. Help would be appreciated

Shafez
  • 1
  • 3

2 Answers2

1

Try this:

$( ".doc" ).remove()

and here's answer for your exact example ( http://pl.tinypic.com/view.php?pic=1yl65u&s=8 ):

$('#actionList').empty();

Paweł
  • 409
  • 3
  • 13
  • that's not working I don't want to remove every li under action list ul – Shafez Jan 19 '15 at 22:26
  • u said "the li's marked with red square what I want to remove". mark with red border want you really want to remove. U have many examples of removal by classes, by content in answers in this question. Try understand how does those functions works – Paweł Jan 20 '15 at 07:23
  • yes there's some li doesn't show all the time in that HTML I just want to remove the ones contains creature in class theres li
  • I don't want to remove with creature
  • – Shafez Jan 20 '15 at 07:55
  • $( "#actionList .creature" ).remove() – Paweł Jan 20 '15 at 08:07
  • tried this and this $('#actionList.actionListItem.creature.creature-0.first').remove(); didnt work :( – Shafez Jan 20 '15 at 08:56
  • u should add space between id and class – Paweł Jan 20 '15 at 08:58
  • still doesn't work .. – Shafez Jan 20 '15 at 09:14