javascript - How get the second td innerHTML -


scenario:

i'm using datatable library display alot of information. table have following rows:

id   type     name      case 

what i'm looking when click second row type, value taking , pasted in textbox

example

id   type     name      case 1    text     juan       20001 3    list     pedro      20005 

if click row has id # 1, need take type innerhtml. not matter apart of row click take second td's html.

i tried code:

$("tr td").click(function () {      alert($(this).html());     }) 

it worked great, problem user have click row name, better if user can click on of row , take second rows html.

suggesstions?

myrow.getelementsbyclassname('td')[1].innerhtml 

should innerhtml of second table cell of myrow long first table cell not contain nested table.

you might try adding click handler rows instead of cells too.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -