dtxnjnrman0428
New Member
I'm trying to highlight a row in my table when someone clicks on it. Here is my table:\[code\]<table> <tr> <td onclick="DoNav('<?php echo $url; ?>');">Name</td> <td onclick="DoNav('<?php echo $url; ?>');">Time</td> <td onclick="DoNav('<?php echo $url; ?>');">Size</td> <td onclick="DoNav('<?php echo $url; ?>');">Length<td> <td><input type="checkbox" value="http://stackoverflow.com/questions/14405427/<?php echo $this->result_videos[$i]["video_name"]; ?>" title="Mark this video for deletion" /></td> </tr>...\[/code\]I've tried some things based on this post: \[code\]jQuery("table tr").click(function(){ var row = jQuery(this); var hasClass = row.hasClass("highlight"); jQuery("table tr").removeClass("highlight"); if(!hasClass){ row.addClass("highlight"); alert("Do I get here?"); }});\[/code\]My css:\[code\].highlight{background-color: #a8cb17;}\[/code\]For some reason the row color doesn't change. I tried putting the jquery code (minus the click) in the DoNav function which just starts a video when you click on the row.What am I doing wrong. Thanks in advance.