I'm trying to bind click events for children of an element like so:
$('#A').children().bind('click',function () {
console.log('Hello');
});
The HTML is
<select id='A'>
<option val='1'>One</option>
<option val='2'>Two</option>
</select>
I've checked out other questions in stackoverflow, such as Bind element and its children in jQuery and the same method is mentioned everywhere. Is there something wrong here?
Edit
I understand that there is a change event available, but, consider the scenario where there is a need to trigger the change event when I select the same option which is selected.
Change only works when options are changed from One
to Two
or vice versa, but what if I select the same option, i.e: Changing from Two
to Two
itself?