In the Web page we have a table link, if we click on that
link all the contents under that link will be sorted
(asscending/Descending). Now i want to check in which order
the list is ? for that i need to get the data in to some var
How can i get that cells data?



In the Web page we have a table link, if we click on that link all the contents under that link wil..

Answer / ganesh

To get data from table cells, u shld use innerHTML.
For that u need to give id's for all the TD's in the Table.
Try the below coding:

<script language="javascript">
function getdatas()
{
var data=document.getElementById('data6').innerHTML;
alert(data);
}
</script>
</head>

<body>
<table width="200" border="1">
<tr>
<td id="data1">ganesh</td>
<td id="data2">magesh</td>
<td id="data3">tanveer</td>
</tr>
<tr>
<td id="data4">satya</td>
<td id="data5">siddiq</td>
<td id="data6">bimal</td>
</tr>
<tr>
<td id="data7">jenson</td>
<td id="data8">nasrulla</td>
<td id="data9">dayanand</td>
</tr>
</table>
<input type="button" value="Get" onclick="getdatas()" />
</body>

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More Scripts AllOther Interview Questions

In the Web page we have a table link, if we click on that link all the contents under that link will be sorted (asscending/Descending). Now i want to check in which order the list is ? for that i need to get the data in to some var How can i get that cells data?

1 Answers   Nous,


How do you insert record into scripting using siebel crm

0 Answers   KPIT,


Difference between the SAP MDM vs IBM MDM in approach, the tools used , ease in handling/implementing.

0 Answers   Wipro,


why script is client dependant.

0 Answers   Bristle Cone,


QTP not able to select multiple row selection when new rows are added

0 Answers  






How can Loading video files in AS3?

1 Answers  


how do u define in ur build.xml If I need to execute a task before executing my task?

0 Answers  


what is the diff between ANT and MAVEN?

2 Answers   Accenture,


how do invoke OS task through ANT?

0 Answers  


If we add regular expressions to a script recorded in QTP, will it effect the performance of the script?

0 Answers  


Hi Guys, I am very new to QTP tool , In real time environment how to test the application with this tool, 1. How to load application in QTP tool 2. How to write test script in QTP. 3. In manual testing we test login box (user id , password) how can we test this kind of testing with QTP tool with examples . Please guys put some focus on my questions , real time ecperienced answers would be appreciate, advance thanks ,please guys i am expecting ur answers as soon as posible

0 Answers  


How to Communicate with JavaScript?

1 Answers  


Categories