<a> (anchor) एलिमेंट एक हाइपरलिंक बनाता है। इसका href गंतव्य (destination) होता है, जो एक URL, एक पाथ, एक इन-पेज anchor, या एक विशेष स्कीम हो सकता है।
External site
Internal page (relative)
Jump to an element with id="section2"
Send email
Call us
<a> (anchor) एलिमेंट एक हाइपरलिंक बनाता है। इसका href गंतव्य (destination) होता है, जो एक URL, एक पाथ, एक इन-पेज anchor, या एक विशेष स्कीम हो सकता है।
External site
Internal page (relative)
Jump to an element with id="section2"
Send email
Call us
<a href="https://other.com" target="_blank" rel="noopener noreferrer">
Opens in a new tab
</a>
target="_blank" एक नया टैब खोलता है, लेकिन आपको rel="noopener" जोड़ना चाहिए: इसके बिना, नया पेज window.opener तक पहुँच सकता है और संभावित रूप से आपके पेज को रीडायरेक्ट कर सकता है (एक "tab-nabbing" अटैक)। noreferrer referrer हेडर को भी हटा देता है। आधुनिक ब्राउज़र _blank के लिए noopener को अंतर्निहित रूप से लागू करते हैं, लेकिन इसे स्पष्ट रूप से जोड़ना सर्वोत्तम अभ्यास है।
<a href="..." rel="nofollow">Don't pass SEO ranking (untrusted/user links)</a>
<a href="..." rel="noopener">Security: no window.opener access</a>
<a href="..." rel="sponsored">Paid/affiliate link</a>
<a href="#top">Back to top</a>
...
<div id="top">...</div> <!-- the link scrolls here -->
क्लिक करने पर पेज उस एलिमेंट तक स्क्रॉल हो जाता है जिसका id फ़्रैगमेंट से मेल खाता है।
Anchors वेब के नेविगेशन की रीढ़ हैं।
href स्कीम्स (relative, absolute, fragment, mailto/tel), target="_blank" + rel="noopener" का सुरक्षा संयोजन, और SEO से संबंधित rel वैल्यूज़ को जानना सही और सुरक्षित लिंकिंग के लिए आवश्यक है।