I have a div declared as follow, but the click event doesn't work. I also need to use the :hover event in the css, but it doesn't work as well. What's the problem ?
<div id="info-button" class="info-button"></div>
the css
.info-button {
position:absolute;
top:-200px;
left:50px;
background-image: url('../img/info-icon.png');
background-size: 100%;
background-position: 0px 0px;
width: 89px !important;
display: inline-block;
height: 89px;
background-repeat: no-repeat;
}
JQuery
$("#info-button").click(function() {
alert("click");
});
I also tried
$("#info-button").on("click", function () {
alert("click");
});
'.info-button:hover { background-color:blue;}