Skip to content

Commit

Permalink
Provide example code for "can users remove all of their selections"
Browse files Browse the repository at this point in the history
  • Loading branch information
alexweissman committed Sep 1, 2017
1 parent 89c517b commit 60e3925
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions docs/_includes/options/selections/clearing-selections.html
Expand Up @@ -29,6 +29,16 @@ <h3>
<h3>
Can users remove all of their selections in a multiple select at once?
</h3>

<p>Yes, see: <a href="examples.html#programmatic">https://select2.github.io/examples.html#programmatic</a></p>

<p>
Yes, by setting the value of the control to <code>null</code>:
</p>

{% highlight js linenos %}
$('select').val(null).trigger('change');
{% endhighlight %}

<p>
See <a href="examples.html#programmatic">https://select2.github.io/examples.html#programmatic</a> for a working example.
</p>
</section>

0 comments on commit 60e3925

Please sign in to comment.