'mmenu.js : How to search synonyms?

I am using the mmenu.js jQuery plugin. It's search function can only search the textnode within each menu item's tag. So for example, I have a menu item like this:

<li><a href="#">Film</a></li>

The search function can only find it with the search keyword 'film'. I need it to find this menu item also with the search keyword 'movie'. So maybe something like:

<li><a href="#" synonym="movie">Film</a></li>

I tried:

<li><a href="#">Film <span class="hide">movie</span></a></li>

It doesn't work.



Solution 1:[1]

You can now use a span with display:none; and your keywords inside as per your second method above. A recent update (March 2022) addressed this.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Josh H