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 pricing

Real-world example

No real-world example available yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

Common mistakes

No common mistakes listed yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

Follow-up questions

No follow-up questions available yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

More HTML5 interview questions

View all →