asp.net listview highlight row on click

后端 未结 1 1844
一生所求
一生所求 2021-01-26 14:14

I know how to set up listview to highlight a row when you click a link, image, etc but I am just wondering if it is possible to set it up to highlight a row when you click on an

1条回答
  •  醉梦人生
    2021-01-26 14:49

    You could use Jquery on the client side:

    $("#myTable tr").click( function () 
    {
       $("#myTable tr").each(function () { $(this).removeClass("selected")}); 
       $(this).addClass("selected"); 
    });​
    

    An example fiddle:

    http://jsfiddle.net/9pmcA/26/

    0 讨论(0)
提交回复
热议问题