For some reason I can't get the class of "selected" to toggle on when each row is clicked
$("tr").click(function() {
$(this).toggleClass('selected');
};
table tr.user:hover {
background: #007A00;
}
table tr.selected {
background: #198719;
}
Should be a simple fix, but I can't see what I'm doing wrong.
$("tr").click(function() {
$(this).toggleClass('selected');
});
You are missing a closing bracket at the end.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.