How to apply Yandex to dynamic menu?

In the html code of the page main menu site is presented in a tree view like this:

ul > li > a
ul > li > ul > li
etc. at any level of nesting

After the page is loaded the JS code scans this menu and turns it into a menu, which is administered only the first level, and the rest appear only when clicking on the corresponding items.

Normally Yandex will index or will think that the page is illegal JS-activity with the forgery of the HTML elements?
July 9th 19 at 10:43
3 answers
July 9th 19 at 10:45
Yandex will index what is in the html code. The fact that in JS, it, most likely, will not see. +I don't think that in Your case we are dealing with a cloaking - should be all the rules.
I of course the code is legal, nothing unpleasant for search engine does not. Just works with the menu. But go and prove Yandex moderators... And Yandex has the potential to emulate the JS and see what's going on with the page... - Bessie.Muller commented on July 9th 19 at 10:48
Maybe but you yourself wrote "Just works with menu" - the problems should not be - Judson_Lowe commented on July 9th 19 at 10:51
July 9th 19 at 10:47
Yandex will index EXACTLY and you will see all the links in the menu. I have one project it is normally treated under links display:none; which opened by clicking on another element. So don't worry.

Heard the opinion that the same display:none or hiding in any other way better to do it via JS, and supposedly the search engines will better relate and will somehow work if the user cut down yourself JavaScript (so he has all the hidden elements will be open, ugly, but works)

If your items are easily accessible when clicks/hover, don't worry - the search engines would react normally. As far as I know, they even follow the links in nofollow and noindex, do not pass on their weight, but still go. So a hidden link is also stopped.
July 9th 19 at 10:49
Today, as long as you're not blocking Googlebot from crawling your JavaScript or CSS files, we are generally able to render and understand your web pages like modern browsers. - Bessie.Muller commented on July 9th 19 at 10:52

Find more questions by tags HTMLYandexSearch engine optimization