consider the example below:
before:
<td name="test1"></td>
<td name="test2"></td>
after:
<td class="test1" name="test1"></td>
<td class="test2" name="test2"></td>
CODE
var table_tr = $("#table tr");
var table_td = table_tr.children("td");
table_td.addClass($(this).attr("name"));
sample code above is just a rough example which is not a working copy.
Problem lies on the 3rd line, the "this" just not refering to each "td".
any great solution without using any loop? thanks!
Added on November 20, 2009, 7:57 pmor I may simplify my problem. since table_td carrying an array of TDs, Any way could make me to use $(this) as a reference pointer to each TD object? thanks!
Added on November 20, 2009, 8:04 pmoh forget it. found my solution. hehe. no person to thanks here. Thanks to myself then.
This post has been edited by choongyouqi: Nov 20 2009, 08:04 PM
Nov 20 2009, 07:52 PM, updated 17y ago
Quote
0.0140sec
0.75
5 queries
GZIP Disabled