Try to use:
$("td[width=65%]")

http://docs.jquery.com/Selectors here you can read about all the
selectors.

On 5 Sep., 02:17, jhead <[EMAIL PROTECTED]> wrote:
> I am wanting to turn all TD tags, that have width="65%", into links,
> based on the tag text, when the page loads.
> I don't have access to change the HTML itself.
>
> I have gotten part way there, but have been unable to get the filter
> to work:
>
> [code]
>                 <script language="JavaScript">
>                         $(document).ready(function(){
>
>                         $("td").filter("width=\"65%\"").click(function () {
>                         $(this).replaceWith("<td width='65%'><a
> href='classDetails.php?class=" + $(this).text() + "'>" + $
> (this).text() + "</a></td>");
>                         });
>
>                         });
>                 </script>
> [/code]
>
> And here is some of the HTML from the document:
>
> [code]
> <tr valign="top">
>             <td nowrap="nowrap" width="10%" align="right">&nbsp;</td>
>             <td nowrap="nowrap" width="20%">&nbsp;</td>
>             <td width="65%">Introductory Chemistry I</td>
>             <td nowrap="nowrap" width="5%" align="right">3</td>
>
>         </tr>
> [/code]
>
> What would I need to add to filter out all the TD tags that don't have
> width="65%"?
> And have it take effect after the page loads instead of on click?
> I tried to replace click with ready, but no effect. And removing the
> ready wrapper breaks things.
>
> Thanks,
> JHead

Reply via email to