Googlebot used to be very limited in its abilities but it has gained several enhancements over the years. One of these is the ability to execute Javascript and hence read its output. This raises valid concerns among webmasters and SEOs. Consider, for instance, the countless problems that might occur if code-generated links are inadvertently crawled. With this in mind, a user from Argentina wanted to know what he can use as a “nofollow” equivalent in Javascript for links and redirections.

Matt Cutts offers a few suggestions. One is to add a nofollow attribute on Javascript links through the appropriate syntax. Exhibiting excellent foresight, the team which implemented code crawling has also made it possible for people to add the attribute via Javascript. If Googlebot sees this, then it will honor the nofollow command as strictly as it has done in the past. Another way is to include some Javascript that is blocked by robots.txt, or to just create the code as normal and then have the generated link go through a URL redirector which is blocked by robots.txt. These techniques are deemed safe and effective in preventing Googlebot from crawling unwanted Javascript links.

Video Link:
Can I use “nofollow” in JavaScript? –