Is there any way to bind an event to option tag in jquery or angularjs. I am specifically looking for a click event to a specific option.
Consider an example here
<select>
<option>Last Month</option>
<option>Last Year</option>
<option onclick='showDatePicker()'>Custom Range</option>
</select>
I have a select dropdown in which there are three options, first two are simple whereas the thirdone is little complicated. Whenever a user chooses the Custom Range (option 3) then I need to show a bootstrap model in which I place a bootstrap custom datepicker. I can make it work by adding a change event handler to select element but then the issue arises that what if the user selects the Ccustom Range option and choose the date using datepicker and close the modal. And after that the user tries to select Custom Range option again to let say change the selected date range. Then this change event won't trigger and thus the bootstrap modal won't showup.
Important Note: We are showing the datepicker (bootstrap or any other) in a modal and once user selects the date that modal will be closed.
ng-clickorng-change?