Background
I have a set of buttons:
I am using jQuery .click()
to detect user clicks.
However, it only works when the user clicks on the text ("imdb" / "rottenTomatoes").
If the user clicks on the blue part of the button, jQuery doesn't recognize it.
You can test this on .
Inquiries
- What seems to be causing the issue?
- How can I make it respond like a button?
Sample Code
html:
<span class="rating">
<span class="rating-btn imdb active">imdb</span>
<span class="rating-btn rt">rottenTomatoes</span>
</span>
css:
.rating {
padding: 14px;
}
.rating-btn {
display: inline-block;
margin-top: 24px;
padding: 4px;
position: relative;
font-family: 'Open Sans',sans-serif;
font-size: 12px;
text-decoration: none;
...
$('.rating-btn').click(function() { ... });