DevPrep
  • Interview Prep
  • Projects
  • Resources
  • Pricing
  • About Us
Submit Question
DevPrep
  • Pricing
  • About Us
Submit Question
← From Beginner to Expert in Fundamentals of Frontend
  • Semantic HTML
  • Accessibility (a11y)
  • Forms & Validation
  • Document Metadata & The <head>
  • The Document Object Model (DOM)
  • Character Encoding & Entities
  • Data Attributes & Custom Data
  • Template, Slot & Web Components
  • Responsive Images: Picture, Source & srcset
  • Loading Strategies & Resource Hints
  • The Native Dialog Element
  • Audio, Video & Media APIs
  • SVG Integration & Canvas Basics
  • Advanced Input Types & Datalist
  • Details, Summary, Progress & Meter
  • Global Attributes & Iframe Security
  • Microdata, Schema.org & Structured Data
  • Open Graph & Social Meta Tags
  • Security Headers & CSP in HTML
  • Link Relations & Canonical Tags
← From Beginner to Expert in Fundamentals of Frontend

Global Attributes & Iframe Security

12 min read
contenteditabledraggablehiddenspellchecksandboxreferrerpolicy

Global Attributes

These attributes can be used on ANY HTML element.

Key Global Attributes

AttributePurposeUse Case
contenteditableMakes element editableInline editing, rich text editors
draggableEnables native drag and dropReorderable lists
hiddenHides element from renderingConditional display
spellcheckEnables/disables browser spellcheckCode editors (disable), text areas (enable)
translateIndicates if content should be translatedBrand names, code (translate="no")
inertMakes element and children non-interactiveBehind modals, disabled sections

Iframe Security

Iframes are dangerous — they can execute scripts, navigate the parent page, and access cookies. The sandbox attribute restricts these capabilities.

Sandbox Flags

  • sandbox (no value): Blocks everything
  • allow-scripts: Allow JavaScript
  • allow-same-origin: Allow same-origin access
  • allow-forms: Allow form submission
  • allow-popups: Allow window.open

Warning: Never combine allow-scripts with allow-same-origin on untrusted content — the script can remove the sandbox.

Practice

  • JavaScript
  • DSA
  • Machine Coding
  • System Design

Resources

  • Learning Tracks
  • Articles
  • Roadmaps
  • Compare Concepts
  • Glossary
  • Developer Tools
  • All Questions

Company

  • About
  • Pricing

Legal

  • Privacy Policy
  • Terms of Service
DevPrep

© 2026 DevPrep. All rights reserved.