I'm using filters to find if an <li>'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.

Here's my example code of what I'm trying to do:

HTML snippet:

<li>Donate</li>

JQUERY code:

$("li.dnt:contains('Donate')").click(function(){
  $(this).text('Remove');
  alert('Donate');
});
$("li.dnt:contains('Remove')").click(function(){
  $(this).text('Donate');
  alert('Remove');
});

In the example above, the first time I click I get an alert of saying
'Donate.'  The second time I click, I should get an alert saying
'Remove,' but instead it just says 'Donate,' even though the text
value has changed.  Am I missing something, or is this sort of
filtering on jquery-generated values not possible?

Thanks!

Philip

Reply via email to