Currently, I am enhancing a project by adding new features. However, I came across a situation where I need to import a different version of jQuery because a plugin requires that specific version. But there is another plugin in the project that relies on the current version of jQuery being used.
Is there a way to run a particular JavaScript code only for a section and then have it removed afterwards? For example:
<section id="sec1"></section>
<section id="sec2"></section>
With the following script:
<script src="main.js"></script>
I am looking to load main.js
exclusively on #sec1
and then destroy it once it's done. Is there a way to accomplish this?