What's the simplest way to change the color of a div by clicking it?
I'm trying to change the background color of a div when clicked. This is
the code I've written:
<div style="background-color:red"
onClick="this.style='background-color:blue'"></div>
For some reason, this hasn't been working. I'm sure it's a syntax problem.
Can anyone help?
Thanks!
No comments:
Post a Comment