There is a select with the Chosen plugin. When I delete an item, I need to do certain actions. Why doesn’t on. (Click) work when I click on the cross?

<select multiple> <option value="1" selected>1</option> <option value="2">2</option> <option value="3" selected>3</option> <option value="4">4</option> <option value="5">5</option> </select> <script> $('select').chosen({width: '100%', height: '40px'}); $(document).on('click', '.search-choice-close', function() { alert("test"); }); </script> 

Example here: https://jsfiddle.net/Colonizator/xpvt214o/719524/

  • Possible reason - the plugin does not forward events further, but interrupts them. See in the description of the plugin whether it is possible to connect to the event of deletion of the selected item. - ArchDemon 4:34 pm

0