<p>Try something like this?</p>

<pre><code>$("#fields-myCateogryField").data("elementSelect")
    .on("selectElements", function(e){console.log(e);})
    .on("removeElements", function(e){console.log(e);});
</code></pre>

CC BY-SA 3.0
2016-01-29T00:16:59.163Z
2016-01-29T00:16:59.163Z
Rick
<p>I have a "Categories" field in my section. I want to perform some JavaScript actions when a category is selected.</p>

<p><strong>Is there any built-in event which will be triggered at that point?</strong></p>

<categories><garnish>
Garnish - Event when selecting a category
# Garnish - Event when selecting a category

(Asked by: username_0 on 2015-08-18)

I have a "Categories" field in my section. I want to perform some JavaScript actions when a category is selected.

**Is there any built-in event which will be triggered at that point?**

**Tags:** categories, garnish

---

## 1 answers

### Answer by username_1 on 2016-01-29. Score: 3

Try something like this?
$("#fields-myCateogryField").data("elementSelect")
    .on("selectElements", function(e){console.log(e);})
    .on("removeElements", function(e){console.log(e);});


---

