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?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

what is the Structure of an ANT file?

1751


database acl level has manager access.his name is listed in author and Reader fields. but he didn't sea a documents what is the reason?

1962


We have 1 web page with names column. I am giving the Service Providers1,2,3.... @ that time dynamically some no of names are displaying in the webpage and The Pop up windows are opening(No.of Pop Up windows=No.of Names). The names may be diffar for each and every Service Provders (Dynamically) How can we handle the Dynamic values?

1623


how do invoke OS task through ANT?

2112


I have installed QTP version 9.0. I have installed Mozilla firefox version 2.0. But QTP "Record and Run settings" in WEB tab shows FIREFOX 1.5 in drop down to run session begins. So QTP does not record anything which I type in firefox. How can i recognise firefox 2.0 and how can i update browser version in QTP?

1778






a="10.20.30.1" replace 1 with 45 in python using reg ex

985


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

6259


how can i type the text message in compose box in yahoo mail using descriptive programming in QTP?

1735


How can you convert QTP 8.2 scripts to QTP 9.2. Please give some inputs ASAP.

2399


I have deducted tds on pay slip for employees ist month tell me how to deposit this amt to govt. by bank or any form is available fill the same and deposit the govt. department. Pls explain me which form to be used for deposit the same with due date.

2855


What is the procedure for installing USP-35 on my compure?

1701


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

1767


How do you insert record into scripting using siebel crm

5066


how can we move to the next column in excel sheet in file operation using descriptive programming inQTP?

1830


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

1768