Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    May 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Remove a cell with class

    Hi,

    I'd like to make a Greasemonkey script that removes the left table from sites running geeklog. This is the particular site I have in mind.

    What I need to do is simply to remove a td classed "block-feature-left".

    I've tried this with no luck:
    Code:
    var elements = document.getElementsByClassName("block-featured-left");
    document.all.removeChild(elements[0]);
    Thank you for the answers and sorry for being such a newbie :-)

  • #2
    New to the CF scene
    Join Date
    May 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Found it out myself. :-)

    This works:

    var elements = document.getElementsByClassName("block-featured-left");
    elements[0].style.display = "none";

  • #3
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,801
    Thanks
    160
    Thanked 2,216 Times in 2,203 Posts
    Blog Entries
    1
    side note: getElementsByClassName() is not implemented in older browsers, so you may need to attach a custom one, see document.getElementsByClassName()
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •