Livequery and other event delegation techniques are cool, but, in a
matter of simplicity
pschwei1 , why don't you try the jQuery toggle event? I think it will
definitely work for this case.
http://docs.jquery.com/Events/toggle#fnfn2fn3.2Cfn4.2C...
On Dec 22, 2:34 pm, Dave Methvin wrote:
> > I'm using filters to find if an 's text matches a certain value,
> > and then changing the value if it does. This works fine. However, if
> > I then use my selectors to check for the new value, jquery does not
> > seem to pick it up, making me wonder if perhaps the selectors only
> > work for values coded into the actual html, not generated by jquery.
>
> Are you executing that block of code each time you change the content?
> The selectors work for the content that exists at the time you execute
> it. So for this:
>
> $("li.dnt:contains('Donate')").click(function(){
> ...
>
> });
>
> The click handler is attached for all li.dnt elements that contain
> "Donate" at that point in time. If you later add the text "Donate" to
> a li.dnt element that didn't previously have it, jQuery is not
> constantly checking the document to determine that you have done
> this.
>
> If you really want that behavior of having jQuery constantly check for
> updates and attaching handlers, check out the livequery plugin.