From 84d6b5d840f7f4e6b7a2fb3f08424bf5495c876d Mon Sep 17 00:00:00 2001 From: Kevin Brown Date: Sun, 27 Mar 2016 14:47:06 -0400 Subject: [PATCH] Added small example of attaching event listeners This closes https://github.com/select2/select2/pull/4255 --- docs/_includes/options/events/jquery.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/_includes/options/events/jquery.html b/docs/_includes/options/events/jquery.html index 680deaa8..0c2bb225 100644 --- a/docs/_includes/options/events/jquery.html +++ b/docs/_includes/options/events/jquery.html @@ -50,6 +50,12 @@ How can I attach listeners for these events? +{% highlight js linenos %} +$('select').on('select2:select', function (evt) { + // Do something +}); +{% endhighlight %} + {% include options/not-written.html %}