Click here to Skip to main content
15,917,481 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
I have function like the following.
HTML
$("#ContentPlaceHolder1_datalstPalylist > tbody > tr").each(function (index) {
                    index = index;
                    $(this).find("td: > table[id=myplayertable] tr").each(function (index1) {
                        var id1 = index + '_' + index1;
                        alert(id1);
                        Playerid.push('m' + id1)
                    });
                });

Can you kindly help me by saying
the 2nd each function acts on which DOM element td, table[id=myplayertable] or tr?
Because if I write the 2nd .each function like following the output is same.
HTML
$(this).find("td: > table[id=myplayertable]").each(function (index1)
Posted
Updated 12-Jun-13 3:55am
v2
Comments
Can you do one thing? Please post the rendered html on browser here, so that I can check at my end or create a fiddle for you.
Sergey Alexandrovich Kryukov 12-Jun-13 17:42pm    
You are right. Besides, OP should better find it out by himself — please see my advice in my answer.
—SA
Oh yes, your advice is really awesome... :)

1 solution

First, it generally depends on your HTML, its DOM itself. Second thing is: you can easily find it out if you output (just for debugging purposes) the node name: http://www.w3schools.com/jsref/prop_node_nodename.asp[^].

—SA
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 13-Jun-13 1:17am    
Thank you, Tadit.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900