parent/child selector issues

parent/child selector issues

Gentlemen,

I'm back with a conundrum for you. I've been happily coding away, adding more and more features to my little project, and finding that things are smoother and smoother as I learn more and more.

But parent/child selectors aren't working for me and it's causing me grief. Here's the code that I want to work:

  1. $("#target > .thick").empty().append('Adding Child Question');

It does nothing!

  1. $("#target").children('.thick').empty().append('Adding Child Question');

Also does nothing! However:

  1. $(".thick").empty().append('Adding Child Question');

Successfully targets .thick - but that's not specific enough, it needs to be the .thick inside #target. I can't give .thick a unique class (not without being able to select it as a child of #target anyway), so this isn't a great situation.

Is the fact that this content has been inserted after the DOM is built possibly behind this? If so, how can I sort this out?

Pointers much appreciated.

Thanks