Why doesnt this work?
$("#button").click(function(){
$("go").css("background-color","yellow");
});
<table><tr id=go bgcolor=#010609><td>hello</td></tr</table>
<input type=button id=button>
JavaScript Code:$("div"). on( "click", "button", function( event ) { $(event. delegateTarget ). css( "background-color", "green"); });
To add the background color, we use css() method. The css() method in JQuery is used to change style property of the selected element. The css() in JQuery can be used in different ways. The css() method can be used to check the present value of the property for the selected element.
attr("data-color"); $("."+class). css("background-color",color); }); . button is the class to apply to the button, add data-class for the class you would like to change the background color of, and data-color is the color you would like to change it to.
go
is an id :
$("#button").click(function(){
$("#go").css("background-color","yellow");
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With