Skip to content

Commit 60e3925

Browse files
committed
Provide example code for "can users remove all of their selections"
1 parent 89c517b commit 60e3925

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

docs/_includes/options/selections/clearing-selections.html

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,16 @@ <h3>
2929
<h3>
3030
Can users remove all of their selections in a multiple select at once?
3131
</h3>
32-
33-
<p>Yes, see: <a href="examples.html#programmatic">https://select2.github.io/examples.html#programmatic</a></p>
32+
33+
<p>
34+
Yes, by setting the value of the control to <code>null</code>:
35+
</p>
36+
37+
{% highlight js linenos %}
38+
$('select').val(null).trigger('change');
39+
{% endhighlight %}
40+
41+
<p>
42+
See <a href="examples.html#programmatic">https://select2.github.io/examples.html#programmatic</a> for a working example.
43+
</p>
3444
</section>

0 commit comments

Comments
 (0)