Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Select a table cell by clicking on it!

Status
Not open for further replies.

celia05es

Programmer
Jan 10, 2002
81
0
0
US
Hello,
I have a table with only one visible cell. Now, if the user selects one cell, the information related to this cell appears in other fields. I don't want to put a button in front of each line. I would like to be able to select the item by clicking on it..... is it possible? If so, how can I do it?... If it's not possible, how can I achieve it?

Thank you
 
Access the onclick event in each cell and call a function to do what you want.
Code:
<table>
 <tr>
  <td onclick="callmyfunction('mydata1')"></td>
  <td onclick="callmyfunction('mydata2')"></td>
  <td onclick="callmyfunction('mydata3')"></td>
 </tr>
</table>

Lee
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top