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")


id string, required
The ID to test against the current Area instance.


Returns boolean true when the given ID is associated with the Area instance. Otherwise, the return value is false.


// 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


No notes

Was this article helpful?

Related Articles

Need Support?

Can't find the answer you're looking for?
Get in touch with us