Interview Question

What is crossorigin attribute?

Crossorigin chooses the cross-origin request mode.

💡 Concept ✅ Quick Revision 🌐 HTML

Answer

The `crossorigin` attribute controls how a resource request handles cross-origin credentials and sharing. β€’ It is written inside an element’s opening tag. β€’ The HTML Standard limits which elements may use it and which values are valid. β€’ Browsers apply the attribute when they process the element or the resource it controls.

💡 Simple Example

<img src="https://cdn.example.com/photo.jpg" crossorigin="anonymous" alt="Photo">

⚡ Quick Revision

Crossorigin chooses the cross-origin request mode.