DiviAreaItem.hasId(id)
Returns true, when the current Area has the specified ID.
Recognized IDs:
- Numeric post ID (e.g.
"2520"
) - Prefixed CSS ID (e.g.
"divi-area-2520"
) - Area Slug (e.g.
"contact-form"
) - Prefixed Area Slug (e.g.
"divi-area-contact-form"
) - CSS ID of inline Popups, free plugin (e.g.
"#learn-more"
)
Params
id
- The ID to test against the current Area instance.
Returns
Returns boolean true
when the given ID is associated with the Area instance. Otherwise, the return value is false
.
Examples
// Get the Area with ID 74335, which has the slug "sample".
var area = DiviArea.getArea('divi-area-74335');
console.log( area.hasId('#divi-area-74335') ); // true
console.log( area.hasId('divi-area-74335') ); // true
console.log( area.hasId('74335') ); // true
console.log( area.hasId('#divi-area-sample') ); // true
console.log( area.hasId('divi-area-sample') ); // true
console.log( area.hasId('sample') ); // true
Notes
No notes