Select a row from html table and send values onclick of a button

The Solution to Select a row from html table and send values onclick of a button is


$("#table tr").click(function(){
   $(this).addClass('selected').siblings().removeClass('selected');    
   var value=$(this).find('td:first').html();
   alert(value);    
});

$('.ok').on('click', function(e){
    alert($("#table tr.selected td:first").html());
});

Demo:

http://jsfiddle.net/65JPw/2/

~ Answered on 2014-07-15 05:53:10


Most Viewed Questions: