seniorHTML5
Explain 'Integrity' and 'Crossorigin' attributes in <script> and <link> tags.
Updated Apr 28, 2026
Short answer
They ensure Subresource Integrity (SRI) and handle CORS for external resources.
Deep explanation
integrity provides a cryptographic hash. If the downloaded file's hash doesn't match, the browser won't execute it. This protects against compromised CDNs. crossorigin is used when you need to fetch resources with CORS requirements.
Unlock with a Pro subscription to view this section.
View pricingReal-world example
No real-world example available yet.
Unlock with a Pro subscription to view this section.
Upgrade to ProCommon mistakes
No common mistakes listed yet.
Unlock with a Pro subscription to view this section.
Upgrade to ProFollow-up questions
No follow-up questions available yet.
Unlock with a Pro subscription to view this section.
Upgrade to Pro