JQuery background color change on button click
Why doesn't it work?
JQuery
$("#button").click(function(){
$("go").css("background-color","yellow");
});
Html
<table><tr id=go bgcolor=#010609><td>hello</td></tr</table>
<input type=button id=button>
+3
user1022585
source
to share
2 answers
go
- id:
$("#button").click(function(){
$("#go").css("background-color","yellow");
});
+12
mgraph
source
to share
Your selector for is go
incorrect.
Try
$('#go').css({backgroundColor: 'yellow'});
+2
Tim b james
source
to share