Generating HTML source on backend, I am using separate independent widgets.
I am simply including pieces of markup like this to the resulting HTML output.
<div> I want to work with this DOM element <script> new Obj(/*but I can't get this <div> as a parameter! */); </script> </div> I'm looking for a way to find the DOM element in which the obj is created (Without any unique IDs). This would add flexibility to my app and speed up the development. But is that technicaly possible in JavaScript?
idto the<div>, and pass the same id into whatever code is in the<script>tag when it is generated.parentXMLmethod in JavaScript for the first time. Could you please show me some code? How can I access the parent DOM element from the running script?