Not sure if the source is like this too, but you haven't closed this element
(insert a </a>):

<a href='#' class="toggleStrike">Remove</a></td>

Maybe, that'll help?

- jake

On 3/2/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:




>  -------Original Message-------
>  From: Jake McGraw <[EMAIL PROTECTED]>
>  Subject: Re: [jQuery] how to find an item when you only know part of
the class name
>  Sent: Mar 02 '07 22:46
>
>  You can reference any attribute using the following notation:
>
>  [EMAIL PROTECTED] Starts with
>  [EMAIL PROTECTED] Ends with
>  [EMAIL PROTECTED] equals
>  [EMAIL PROTECTED] contains
>
>  So for your problem...
>
>  $("[EMAIL PROTECTED]")
>
>  Hope this helps,
>
>  - jake
>
>
>  On 3/2/07, [LINK: MAILTO:[EMAIL PROTECTED]
>  [EMAIL PROTECTED]  <[LINK: mailto:[EMAIL PROTECTED]
]
>  [EMAIL PROTECTED]> wrote: Hi,
>
>  I have a DIV whose ID I know.  Within that DIV is a table with a table
>  cell which either has a class beginning with the word "title" and
followed
>  by an integer.  I would like to reference the text within that table
cell.
>  What is the easiest way to get a reference to this cell?
>
>  Thanks, - Dave
>
>  _______________________________________________
>  jQuery mailing list
>  [LINK: mailto:[EMAIL PROTECTED] discuss@jquery.com
>  [LINK: http://jquery.com/discuss/] http://jquery.com/discuss/

I appreciate your reply.  I'm still not finding the element, and I wanted
to ask what I was doing wrong.  The JS is

        $(document).ready(
                function () {
                        $('a.toggleStrike').click( function() {
                                var parentDiv =
$(this).parents("[EMAIL PROTECTED]");
                                alert(parentDiv[0].id);
                                var tdElt = parentDiv.find
("[EMAIL PROTECTED]");
                                alert(tdElt[0].id);
                                var textDecor = tdElt.css
('text-decoration');
                                var newDecor = textDecor == "line-through"
? "none" : "line-through";
                                tdElt.css('text-decoration', newDecor);
                        });
                }
        )

and a sample HTML div would be

                        <div id="toc25" class="tocItem15-2"
style="display:block; margin-left:30px">
                                <div style="display:block"><table>
                                        <tr>
                                                <td></td>
                                                <td
style="text-decoration:none" class="title3">Lesson 1 Core Ancient
Americans</td>
                                                <td><a class="readMore"
href='#'>Read</a></td>

                                                <td><a href='#'
class="toggleStrike">Remove</td>
                                        </tr>
                                </table></div>
                        </div>

The first alert displays the correct value, but the second alert displays
a blank box and subsequently everything in the highest level table gets a
strike through it when I just want this one cell.

Thanks, - Dave

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to