What is the default value of "rel" attribute on an anchor tag?

3.8k Views Asked by At

I have to set rel value as noopener like rel="noopener" in a desktop view but not in mobile view. page is responsive, so i have same html for desktop and mobile.

i want to do some thing like this:

<Link to="/nextpage" rel={desktopView ? 'noopener' : ''} />

but for mobile it is rel='' which is i think wrong. so i want to put default value of rel for mobile view. so what is the default value of rel ?

any help will be appreciated. Thanks in advance.

2

There are 2 best solutions below

2
Quentin On

The rel attribute's default value is an empty list.

0
Muhammad Junaid On

By default rel is empty or a empty list as mentioned before.

HTML5 defines some values for the rel attribute: http://www.w3.org/TR/html5/links.html#linkTypes

For the use in HTML5, all other link types need to be defined/listed on this page in the microformats wiki: http://microformats.org/wiki/existing-rel-values#HTML5_link_type_extensions