Provide example code for "can users remove all of their selections"
This commit is contained in:
parent
89c517b589
commit
60e3925128
@ -30,5 +30,15 @@ $('select').select2({
|
||||
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>
|
||||
|
Loading…
x
Reference in New Issue
Block a user