Get cell values when it is clicked

Posted by Hiroyuki under IIS on 10/26/2010 | Points: 10 | Views : 4532 | Status : [Member] | Replies : 1
Hello..please help with my problem since Im new in using
HTML and javascript.

I have this table that has rows and columns.
Hello..please help me with my problem since Im new in using
HTML and javascript.

I have this table that has rows and columns.
When i click the value of the cell, it will return
the values of the cells of the same row.

Example


<TABLE>
<TR>
<TD>xyz</TD>
<TD>xxx</TD>
</TR>
<TR>
<TD>abc</TD>
<TD>aaa</TD>
</TR>
</TABLE>

So if I click cell with xyz value, it should return xyz and xxx values.

Im thinking of using onClick in TD tag then get the values as arguments
for the function.

<TD onClick="GetVal(this);">xyz</TD>


is this possible?

how can i manipulate the values sent to the function?
please help me..




Responses

Posted by: T.saravanan on: 10/27/2010 [Member] [MVP] Silver | Points: 25

Up
0
Down
Hi,

Refer the following link its will helpful to you.

http://www.velocityreviews.com/forums/t499268-get-table-cell-value-using-javascript.html

http://bytes.com/topic/javascript/answers/92166-get-table-cell-value

Cheers :)

Thanks,
T.Saravanan

Hiroyuki, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response