[html] Valid to use <a> (anchor tag) without href attribute?

It is valid. You can, for example, use it to show modals (or similar things that respond to data-toggle and data-target attributes).

Something like:

<a role="button" data-toggle="modal" data-target=".bs-example-modal-sm" aria-hidden="true"><i class="fa fa-phone"></i></a>

Here I use the font-awesome icon, which is better as a a tag rather than a button, to show a modal. Also, setting role="button" makes the pointer change to an action type. Without either href or role="button", the cursor pointer does not change.

Examples related to html

Embed ruby within URL : Middleman Blog Please help me convert this script to a simple image slider Generating a list of pages (not posts) without the index file Why there is this "clear" class before footer? Is it possible to change the content HTML5 alert messages? Getting all files in directory with ajax DevTools failed to load SourceMap: Could not load content for chrome-extension How to set width of mat-table column in angular? How to open a link in new tab using angular? ERROR Error: Uncaught (in promise), Cannot match any routes. URL Segment

Examples related to anchor

How to open a link in new tab using angular? Attaching click to anchor tag in angular How to create a link to another PHP page Making href (anchor tag) request POST instead of GET? Difference between _self, _top, and _parent in the anchor tag target attribute How can I create a link to a local file on a locally-run web page? How to open link in new tab on html? Getting a link to go to a specific section on another page Pure CSS scroll animation Make anchor link go some pixels above where it's linked to

Examples related to semantic-markup

Should I use <i> tag for icons instead of <span>? Valid to use <a> (anchor tag) without href attribute? Is it correct to use DIV inside FORM? Best HTML5 markup for sidebar input type="submit" Vs button tag are they interchangeable? Correct Semantic tag for copyright info - html5 <code> vs <pre> vs <samp> for inline and block code snippets CSS/HTML: What is the correct way to make text italic? Span inside anchor or anchor inside span or doesn't matter? Is a DIV inside a TD a bad idea?

Examples related to htmlbutton

How to call a PHP function on the click of a button How to create a HTML Cancel button that redirects to a URL Valid to use <a> (anchor tag) without href attribute? Can I make a <button> not submit a form? Trigger a button click with JavaScript on the Enter key in a text box