We all know how good Google is at understanding and crawling JavaScript, AJAX and complex web pages in many forms, but Google's John Mueller said, when it comes to discovering links within onclick events in JavaScript, sometimes Google is not able to follow such links.
John said on Twitter "If links are added as normal "a" elements with "href" attributes using JS, that's fine." "Sometimes people add "onclick" events instead of links, that's not always something we can notice & crawl through," he added.
Sometimes! If links are added as normal "a" elements with "href" attributes using JS, that's fine. Sometimes people add "onclick" events instead of links, that's not always something we can notice & crawl through.
— John ☆.o(≧▽≦)o.☆ (@JohnMu) April 17, 2018
I suspect Google is better at this then they let off to be. :)
Forum discussion at Twitter.