how to put the content formed from script tag inside div
Does anyone know how to put all the content form from <script src="cdn/example.js" />
in div tag ?
let's say above example generate code
<div class="class1">
<h1>Test</h1>
</div>
can this generated code be wrapped ?
<div className=styles.customClass>
{above content}
</div>
2 Replies
Can I ask why?
@vince._ I'm working on userway
where I'm getting the script from cdn.userway.org/widget.js
which is loading accessible widget
I like to show this widget icon on specific location only
which can be done if the content inside it can be loaded on a specific div
<script>(function(d){var s = d.createElement("script");s.setAttribute("data-account", "9bypO3Ua9N");s.setAttribute("src", "https://cdn.userway.org/widget.js");(d.body || d.head).appendChild(s);})(document)</script><noscript>Please ensure Javascript is enabled for purposes of <a href="https://userway.org">website accessibility</a></noscript>
you can consider above example