htmljquerycsstwitter-bootstrapbootstrap-multiselect

Uncaught ReferenceError: multiselect is not defined


I use boostrap for an multiselect element. I want unselect an opion but I have this error:

antinsfw:222 Uncaught ReferenceError: multiselect is not defined
at cancel (antinsfw:222)
at HTMLButtonElement.onclick (antinsfw:172)

Full code of my page: https://haste.flo-x.fr/urutonelay.xml.

elements concerned:

<select class="selectpicker border-gray txt-gray bg-dark" title="select an channel" id="multi-select" multiple>
  {% for channel in channel %}
  <option id="option_multidict" value={{channel[0]}} class="bg-dark txt-gray" {% if channel[0]|string in position %} selected {% endif %}>{{channel[1][:14]}}</option>
  {% endfor %}
</select>

and js code:

jQuery('selectpicker').multiselect('deselect', ['1']);

Thanks for you answers!


Solution

  • Make jQuery('.selectpicker').selectpicker('deselect', '0'); and it works.