Filter entries with AJAX
For filtering entries using JS, you could use Isotope JS

First, in your markup give each entry class attribute representing id of category that entry has:

{% for entry in entries %}
&lt;a href="{{entry.url}}" class="category-{{entry.categoryField.one().id ?? null}}"&gt;{{entry.title}}&lt;/a&gt;
{% endfor %}


Then, you will be able to show entries related only to a specific category using JS code like this:

$grid.isotope({ filter: '.category-5' });


..assuming you defined your isotope grid earlier as $grid. In this example, Isotope will show all entries related to the category with id 5.