Rel attribute

I noticed that the "rel" attribute is not used by browsers at all, does this make it an ideal place to store additional information for javascript (for example, an ajax request for deletion can read id from rel)

+3
source share
4 answers

I noticed that the "rel" attribute is not used by browsers at all

You noticed a mistake. Browsers use it (for example, some browsers have a key combination to go to the next page and can use the rel attribute to determine what it is). Search engines also use it (e.g. nofollow).

makes it an ideal place to store additional information for javascript

. . , .

+9

, , javascript. :

data- (. ).

<a href="somelink.html" data-id="5">Link 5</a>

/ jQuery

+12

, , , do rel. SEO , SEO, rel rel ... rel="nofollow", .

+1

You can simply create your own custom attributes, but make sure you name it now so as not to conflict with other js libraries that you can use.

-1
source

All Articles