How to add a new options to JQuery Chosen Plugin Dynamically

10 sec read

If users is the id of the select Chosen dropdown box, then use JQuery to append new options dynamically as in the example below

$("#users").append('<option value="1">User</option>').trigger("chosen:updated");

.trigger(“chosen:updated”);  refreshes the Chosen dropdown box with the new option.

Last Updated On March 21, 2018

Leave a Reply

avatar
  Subscribe  
Notify of