How to add custom javascript into rendered note

Hi All,

I'm developing a plugin and would like to add custom JS to render content. Could you guide me to example or documentation where I can find it.

Thanks!

Check out this plugin by @ambrt

thanks, I've checked it. However, the question is still open - when it runs?
I need to apply JS on a particular DOM element after I got the note updated - can you help me with that please?

I believe it runs whenever a note is rendered. Is that what you need?

@anantaramdas

AFAIK there is no native event for it.
I do work around by inserting style element and use it's onload to fire up JS code.

<style onload="alert('test')"/>
It launches as soon as tag gets into DOM.

So for example you could insert style tag and have its onload wait for DOM element with intervals.