tags:

views:

24

answers:

3

my HTML:

<li class="accept  accepted" name="javascript_required" style="display: block; " id="accept">
            <div id="accept-text" style="display: block; ">
                Contract was Accepted
            </div>
            <a href="/view/close_contract/89?status=2" rel="facebox">Accept This Controct</a></li>

then my jQuery that i'm trying in the webkit console:

$j('li#accept').remove('a');

the above command reterns

Object
> 0: HTMLLIElement
> context: HTMLDocument
  length: 1
> prevObject: Object
  selector: "li#accept"
> __proto__: Object

After entering the command, the anchor remains in the DOM =(

+1  A: 

Your selector is wrong, try $('li.accept').remove('a');

SBUJOLD
@SBUJOLD Actually his selector looks fine. If you scroll over the id of the li element is accept. I thought similarly at first as well.
spinon
DOH, right. well your answer is marked as accepted now so that's good. Do you know why his code wouldn't work then ? Seems based on the documentation it should have ?
SBUJOLD
+2  A: 

Use this instead:

$('li#accept > a').remove();
spinon
+2  A: 

This http://interestingwebs.blogspot.com/2009/04/jquery-selectors-samples.html describes selectors in jQuery - it's a really nice one.

I would use:

$("#accept > a").remove();
MartyIX
+1, http://api.jquery.com/remove/
Biswanath