I have some spans that I am trying to toggle the display of when the pointer hovers on them using jQuery and the CSS visibility property (display property is fine too, but neither has worked just far). The spans' code is as follows:
.buy1 {
visibility: hidden;
}
<span class="buy1">
<h3><a href="#">buy</a></h3>
</span>
Likely the reason is that my jQuery is wrong, as it's not my strong suit. Anyone have a suggestion of something that would work better?
<script type="text/javascript">
$( document ).ready(function() {
$( "span.buy1" ).hover(function() {
$("span.buy1").css("visibility","visible");
});
});
</script>