In my html I have div that needs to be respond to user clicks. I have a new requirement to add some input controls within that div, however clicking on them causes the click event of the div to be fired.
Is it possible to prevent this from happening without interfering with the functionality of the input?
$('.click-me').click(function(){
$(this).css("background-color", "#F00");
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<div class="click-me">
I can be clicked
<select>
<option>Option One</option>
<option>Option Two</option>
<option>Option Three</option>
</select>
</div>
This is different to the suggested duplicate because I'm not attaching an event to the select list, the browser does that by itself. I want to allow the normal event on the select list to play out but not call the event on the div that is behind it