Performance: Email and phone links
This affects page load speed minimally but impacts user interaction responsiveness and accessibility.
<a href="mailto:example@example.com">Email us</a> <a href="tel:+1234567890">Call us</a>
<span onclick="window.location.href='mailto:example@example.com'">Email us</span> <span onclick="window.location.href='tel:+1234567890'">Call us</span>
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Using <span> with onclick for mailto/tel | Adds event listeners | 0 reflows | Minimal paint | [X] Bad |
| Using <a href="mailto:"> and <a href="tel:"> | No extra DOM ops | 0 reflows | Minimal paint | [OK] Good |
mailto: prefix do when used in an <a> tag?mailto: prefixmailto: prefix in an <a> tag tells the browser to open the default email program when clicked.tel: prefix is for phone calls, not emails. Other prefixes like http: open websites.mailto: = email link [OK]tel:. It tells the browser to open the phone dialer.<a> taghref attribute should be tel:1234567890 to work properly.tel: prefix = phone link [OK]<a href="mailto:info@example.com">Email us</a>
href attributehref uses mailto: with an email address, which triggers the email client.mailto: opens email client [OK]<a href="tel1234567890">Call us</a>
href syntaxtel prefix must be followed by a colon : to be valid.tel fixes the link to href="tel:1234567890".href="tel:1234567890" -> Option Btel: syntax needs colon [OK]aria-label attributes to describe the links for screen readers.title which is less reliable for accessibility.Pass the test and this pattern moves unknown