I am using line index property of TR but it is not working. Please tell me that I am doing something wrong here.
function myMethod () {warning (this.parent.rowIndex); // parentNode is also used}
HTML
& lt; Table range = "1" & gt; & Lt; TR & gt; & Lt; Td onclick = "myMethod ();" & Gt; 1.1 & lt; / Td> & Lt; TD & gt; 1.2 & lt; / TD & gt; & Lt; TD & gt; 1.3 & lt; / TD & gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt; Td onclick = "myMethod ();" & Gt; 2.1 & lt; / Td> & Lt; TD & gt; 2.2 & lt; / TD & gt; & Lt; TD & gt; 2.3 & lt; / TD & gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt; Td onclick = "myMethod ();" & Gt; 3.1 & lt; / Td> & Lt; TD & gt; 3.2 & lt; / TD & gt; & Lt; TD & gt; 3.3 & lt; / TD & gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt; Td onclick = "myMethod ();" & Gt; 4.1 & lt; / Td> & Lt; TD & gt; 4.2 & lt; / TD & gt; & Lt; TD & gt; 4.3 & lt; / TD & gt; & Lt; / TR & gt; & Lt; / Table & gt;
This "window" in "parent.rowIndex" does not try the TD element
& lt; Td onclick = "myMethod (this);" & Gt; 1.1 & lt; / Td> Function Mymouth (OBJ) {Warning (obj.parentNode.rowIndex);}
No comments:
Post a Comment