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

How to Communicate with JavaScript?

1 Answers  


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

1 Answers  


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

1 Answers   HP,


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

1 Answers   Wipro,


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?

1 Answers  


why do u need an ANT?

1 Answers  


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?

1 Answers   Nous,


Why we use Action Script(Multimedia Flash) rather than using other scripting languages (JAVA,VB...etc) ?

1 Answers   Wipro,


how do i compose the text message in the yahoomail using descriptive programming in QTP?

1 Answers  


What is a Scripting Language?

2 Answers  


How to double click on Simple HtmlText in SilkTest automation tool?

1 Answers  


How can we return a value from User Defined Function ? For Eg. we have 2 functions. In Fun1 i am getting 2 values (a,b) and i am addding those 2 and storing in to another var (c). Now i want to pass that var(c) to another function (fun2). What will be the script?

6 Answers   Nous,


Categories