You could try using regular expressions on the text inside of each TD.
Something like this:

$(this).find("td:contains('*')").each(function(){
  $(this).text().replace(/\*/g, "<span class='highlight'>*</span>");
});

The above code is untested and may not work, but you get the picture.



On Mar 26, 3:00 pm, Feed <[EMAIL PROTECTED]> wrote:
> Hello all,
>
> I'm having a hard time trying to make a script. This is the whole
> picture:
>
> - I have lots of tables in the same page
> - Each of those tables has a button that, once pressed, find and
> highlight all '*' characters inside the table
>
> What I'm thinking about doing is:
>
> Find all TDs that contain '*' inside:
>
> $(this).find("td:contains('*')");
>
> Ok, this worked, I found the TDs.... but now I have to look inside
> these TDs and highlight ONLY the * character.... how can I do it? I
> need to find the * and then wrap it in a span... in the end there will
> be something like this:
>
> "I found the <span class="highlight">*</span>, yay!"
>
> Thanks in advance.

Reply via email to