{"record":{"id":"d4b168a7c98d23fa","repo":"oxc-project/oxc","slug":"missing-title-attribute-for-the-iframe-element","errorCode":null,"errorMessage":"Missing `title` attribute for the `iframe` element.","messagePattern":"Missing `title` attribute for the `iframe` element\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/oxc_linter/src/rules/jsx_a11y/iframe_has_title.rs","lineNumber":17,"sourceCode":"use oxc_ast::{\n    AstKind,\n    ast::{JSXAttributeValue, JSXExpression},\n};\nuse oxc_diagnostics::OxcDiagnostic;\nuse oxc_macros::declare_oxc_lint;\nuse oxc_span::{GetSpan, Span};\n\nuse crate::{\n    AstNode,\n    context::LintContext,\n    rule::Rule,\n    utils::{get_element_type, get_prop_value, has_jsx_prop_ignore_case},\n};\n\nfn iframe_has_title_diagnostic(span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(\"Missing `title` attribute for the `iframe` element.\")\n        .with_help(\"Provide `title` property for `iframe` element.\")\n        .with_label(span)\n}\n\n#[derive(Debug, Default, Clone)]\npub struct IframeHasTitle;\n\ndeclare_oxc_lint!(\n    /// ### What it does\n    ///\n    /// Enforce iframe elements have a title attribute.\n    ///\n    /// ### Why is this bad?\n    ///\n    /// Screen reader users rely on a iframe title to describe the contents of\n    /// the iframe. Navigating through iframe and iframe elements quickly\n    /// becomes difficult and confusing for users of this technology if the\n    /// markup does not contain a title attribute.","sourceCodeStart":1,"sourceCodeEnd":35,"githubUrl":"https://github.com/oxc-project/oxc/blob/e1e7af627c8843ab64044ed466b128fcc21a035b/crates/oxc_linter/src/rules/jsx_a11y/iframe_has_title.rs#L1-L35","documentation":"Raised by jsx-a11y/iframe-has-title when an <iframe> element lacks a title attribute. Screen readers announce the title to describe the iframe's content; without it users of assistive technology cannot know its purpose.","triggerScenarios":"Thrown at crates/oxc_linter/src/rules/jsx_a11y/iframe_has_title.rs:17 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add a descriptive title attribute to the iframe, e.g. <iframe title=\"Embedded video player\" />.","For iframes with no meaningful content, title them as decorative (e.g. title=\"Advertisement\")."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e1e7af627c8843ab64044ed466b128fcc21a035b","analyzedAt":"2026-08-20T07:01:07.079Z","contentChangedAt":"2026-08-20T07:01:07.079Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}