I’m having duplicate HTML embeds on the same page, one of them works other doesn’t. Why doesn’t the browser read the second one or what might cause the problem?
I tried to change the classes of the second embed, didn’t work
Your staging site is password protected, so it’s not possible to check for script errors.
However the main problem I see is that both of dropdown lists are using the same ID, and your scripts are acting on that same ID. If both are running successfully, they’re both probably affecting the first list only.
Also, you should move the <style> content into the HEAD custom code, and your <script> into the BODY custom code. You only need one copy of those, as @aaronocampo advised. You’d need to make some changes to your script as well so that one script will work properly for both buttons.
Hi Ove, getElementById can only take one ID.
My guess is you’ve inherited some code that you’re trying to fix, or used ChatGPT to generate the basics? However you’ll need a different approach and I’m suspicious about that input event listener, it looks like you’re trying to create an autocomplete feature of some form.