I'm trying to make a simple JQuery button from a div which will change background color when rolled onto/off of.
My code so far looks like this:
<html>
<head>
<title>Div Test</title>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$("div").hover(function() {
$(this).css({'background-color' : 'yellow'});
});
</script>
<style type="text/css">
#mainButton {
color: #FFF;
width: 100px;
height: 50px;
background-color: #333;
}
</style>
</head>
<body>
<div id="mainButton">
<p align="center">Button</p>
</div>
</body>
</html>
However, I can't get it to work. My button initially displays fine, but no yellow background on roll over. :-|