I have something like this:
\' onclick=\"SetBackgroundColor(this)\" style=\"background-color:Yellow\">
Whe
-
In jQuery you do not have to use the onclick attribute to assign an event handler. Lets say you add a class called mytr to each tr that you want to affect. Then you can do something like this:
$(document).ready(function(){
$(".mytr").click(function(){
$(this).css("background-color", "#000000");
});
});
And that will apply the event handler to all rows with the class mytr.
- 热议问题