79474500

Date: 2025-02-28 04:22:18
Score: 1
Natty:
Report link

It would be best to stick to the options described in this answer.

Even if the code tries to "catch" the element right after its creation, this may cause problems with the general parsing of the page, and wouldn't be a reliable solution in terms of making sure the code is executed right after (rendering?) that div.

My advice would be to put an external link into the head:

<script src="script.js" defer></script>

And find a way to catch your element's "creation" with native or custom event-attributes. Here seems to be a creative solution.

Reasons:
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: Artem Shush