Monday, August 27, 2012

javascript – how to get exact id values of a table

I\’m trying to sort out this problem but have yet to get results. I tried to get the exact id values of the row which I edit in order to perform an update.


I can get get my current cell value but I can\’t get the corresponding id values of the cell. I iterate over the table id value which in turn get\’s all the id values of the table.


I\’m using this jquery code for iteration:



$(\'#table\').ready(function() {
$(this).find(\'.filename\').each( function() {
alert($(this).html());
})
})


Then I tried this simple JavaScript:



var fid= document.getElementById(\"filename\").textContent;


It gets only the first id value of the table.

For example, if I edit the first row the id value is 53.

If I edit the second row the id value should be 52 but it gets only 53.


See this link , I have posted this question previously.






Rating: 2 out of 5 based on 3 ratings



The post javascript – how to get exact id values of a table appeared first on Javascript ASK.






via Javascript ASK http://javascriptask.phpfogapp.com/javascript-how-to-get-exact-id-values-of-a-table.html

No comments:

Post a Comment