Hi. Here is base. Change or add the code in accordance with your case and selectors. If you will can't figure it out, then just hire someone for this work or try ChatGPT, or use the very first way (a module in debug position). Since there were already enough examples above for your success with this. I do not know how to explain more clearly. At least the basic skills of HTML/CSS/JS are required to understand.
Code: Select all
// Check if there is more then 0 elements with class "my-slider"
if (document.querySelectorAll("my-slider").length > 0) {
// Create a <link> element
let link = document.createElement("link");
link.rel = "stylesheet";
link.href = "path/to/your/styles.css";
// Create a <script> element
let script = document.createElement("script");
script.src = "path/to/your/script.js";
// Append the <script> and <link> elements before closing body tag
document.body.appendChild(link);
document.body.appendChild(script);
}