Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript jQuery Append and then remove

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #25303
    Benjamin
    Participant

    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!

    #59906
    Mr KiTT3N
    Member

    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

    #59947
    Benjamin
    Participant
    "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!

    #60077
    Hugo
    Member

    How’s this:

    Code:
Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.