Is there any way to fire an event when an object of a certain type is created?
I have an <div>
element with editableContent="true"
and when the user presses enter within the <div>
, a new <div>
is created that takes up just that line. Is it possible to have an event fire whenever a <div>
object is created within my original <div>
object?
I know one way to do this would to listen for keystrokes and on an 'enter' key being pressed, do a bunch of logic to figure out what to do, but this seems a lot less elegant - so it would be great if there was another way.
Thanks!