IT Certificaions

Google Cloud Platform

Monday, June 18, 2012

Highlight row on click using jquery

If you want to highlight a row on click, include jquery js at your head tag and add following...


<style type="text/css">
    
    tr.walkRows td {
       background: #D7DF23;
    }  


</style>

<script type="text/javascript">
 $(document).ready(function() {
$('tr').click(function () {
     $(this).toggleClass('walkRows');
    });  
 });
</script>