Grow your CSS skills. Land your dream job.

jQuery Append and then remove

  • # June 29, 2009 at 2:31 pm

    Hello.

    I am using jQuery to append a list item when a box is checked and when it is unchecked I want that list item to go away. I got the first part to work, but not the second (removing portion). Here is a paired down version of my issue http://theschaafs.org/checked.html.

    I can’t get down into the :not(:checked) portion of the code.

    Here is what I have thus far…

    Code:

    Thanks for looking into it!

    # June 30, 2009 at 3:57 am

    Few things to note,

    var title = $(this).attr("title");
    This will return <input type=checkbox title="title">

    And this is fine but you shouldn’t be appending the title without wrapping….

    Also if("input:checked") is just a string
    "input:checked" != anything

    Code:

    So something like that …. that should get you on the right track

    # June 30, 2009 at 1:41 pm
    "Mr KiTT3N" wrote:
    Few things to note,

    var title = $(this).attr("title");
    This will return <input type=checkbox title="title">

    And this is fine but you shouldn’t be appending the title without wrapping….

    What do you mean by without wrapping?

    I am trying to get the value of the title attribute…are you saying I am only looking for titles with the title of title? ;)

    Thanks Mr. KiTT3N!

    # July 2, 2009 at 1:23 pm

    How’s this:

    Code:
Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".