I'm asking this because I have some links that act like buttons that pull out content trough ajax, so I don't need any href on them.
(I'm asking this from the SEO perspective)
An a[href] element is a link (which is why they are matched with :link in css). links are clickable. An a element without the [href] attribute is otherwise just a placeholder for where a link might otherwise have been placed, and not clickable, nor are they in the tabbing order of the page.
Anchor tag (HTML A tag) attributes Some attributes are optional like 'target=', but the href attribute is mandatory in order to create functional links.
HREF is required when an anchor tag needs to be a hyperlink.
The HTML <a> href Attribute is used to specify the URL of the page that the link goes to. When the href attribute is not present in the <a> an element that it will not be a hyperlink. This attribute is used to specify a link to any address.
I am assuming that by "links" you simply mean a
elements. If that's true then:
No. At least, not in the HTML5 draft specification:
If the a element has no href attribute, then the element represents a placeholder for where a link might otherwise have been placed, if it had been relevant.
From the HTML 4.01 specification:
Authors may also create an A element that specifies no anchors, i.e., that doesn't specify href, name, or id. Values for these attributes may be set at a later time through scripts.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With