I wan\'t to change the background color of a div dynamicly using the following HTML, CSS and javascript.
HTML:
-
2020-12-10 01:22
test.html
jQuery Test
test.css
.menuItem
{
display: inline;
height: 30px;
width: 100px;
background-color: #000;
}
test.js
$( function(){
$('.menuItem').hover( function(){
$(this).css('background-color', '#F00');
},
function(){
$(this).css('background-color', '#000');
});
});
Works :-)