Is it possible to use CSS within JQuery to gradually change the color of a div
? Additionally, how can I incorporate a second function into my <div>
? Below is the code. I would like the color to revert back to its original state when the mouseout
event occurs.
<script>
function myFunction() {
$(document).ready(function () {
$("#square").css({ backgroundColor: 'blue' });
});
}
</script>
<div id="square" onmouseover="return myFunction()">Focus on me!</div>