Does onClick affect SEO value?

I wonder if there is a difference in SEO between using a regular href link or creating a clickable element by adding javascript onclick?

A basic example of my two options ...

<a href="myUrl">Link</a>

<div onclick="javascript:yUrl">Link</div>
+3
source share
3 answers

Since web spiders are (still) without Javascript, there is an obvious difference between the two bits of code, it can be followed by a bot (and someone else), and the other only works for users with Javascript enabled (like that, not Google). For spiders, this should be nothing more than a div, and any URL that you set using onclick will not execute (and therefore will not be indexed from this page).

+5

, , Google JavaScript. , . , , rel="nofollow".

+3

, . - , , JS, JS- ( ). , JS , , , - , JS , . , .

- , [], , hrefs , , rel .

+1
source

Source: https://habr.com/ru/post/1761313/


All Articles