So inside my JavaScript, I have the following snippet:
const map = $window.find('#map-office-' + $sender.data('office_id'));
Now inside the first element, there is a children attribute, which shows the following:
When the <script> tag is disabled, it shows no children.

When the <script> tag is enabled, it shows children.

How can I make it where it would act like this:
If map doesn't have children, inject a innerHTML message, otherwise render showMap function.
All help is appreciated!