18
I have a table that has a section similar to the following:
<tr>
<td> <span class="myclass"></span>
</td>
<tr>
my $(this) is set to the tr element and I'm trying to access the Span elements that have the "myclass" class set. The following seems to work:
if ($(this).children('td').children('span').is('.myclass')){
alert('in here');
}
but when trying to use this:
if ($(this).children("td > span").is('.myclass')){
or this:
if ($(this).children("td span").is('.myclass')){
It does not. I thought that either of the above 2 would come up with similar results (albeit through different methods) but apparently not.
What am I missing here?
Thanks!