Javascript selecting row

Author Message
morpheus83uk

  • Total Posts : 738
  • Scores: 0
  • Reward points : 0
  • Joined: 8/21/2006
  • Status: offline
Javascript selecting row Monday, June 06, 2011 3:11 AM (permalink)
0
Hello,
 
I am after getting a cell value from a clicked Cell ..
 
So far I have teh following javascript function:
 
<script type="text/javascript">
function getInfo()
{
var Row = document.getElementById("tblrow");
var Cells = Row.getElementsByTagName("td");
alert(Cells[0].innerText);
}
</script>
 
Which is on the onclick event of my tablerow it works fine but only gets the first name in the list regardless of which cell I click...
 
Does anyone know how I can get it to give the value of the row which is clicked?
 
Many Thanks
 
James
 
#1

    Online Bookmarks Sharing: Share/Bookmark

    Jump to:

    Current active users

    There are 0 members and 1 guests.

    Icon Legend and Permission

    • New Messages
    • No New Messages
    • Hot Topic w/ New Messages
    • Hot Topic w/o New Messages
    • Locked w/ New Messages
    • Locked w/o New Messages
    • Read Message
    • Post New Thread
    • Reply to message
    • Post New Poll
    • Submit Vote
    • Post reward post
    • Delete my own posts
    • Delete my own threads
    • Rate post

    2000-2012 ASPPlayground.NET Forum Version 3.9