Toggle Visibility of Separate Javascript Files on Same Page
-
I have two separate javascript files that I would like to load on a single page, but toggle visibility/display of either based on radio button input. The JS is provided by a 3rd party and is offsite. Their provided code is this:
<script src="https://toolkit.rescuegroups.org/j/3/FzemP6HU/toolkit.js"></script>
and
<script src="https://toolkit.rescuegroups.org/j/3/4ANRW3x8/toolkit.js"></script>
Each file presents a separate set of filtered results from their database. How can I incorporate both onto a page but only have one or the other showing based on a radio button form input. I would like the page to start off with nothing visible (hopefully giving time for both JS to load in the background while the user selects an option) and then show one or the other depending on what they selected.You can see a single one of these in action at https://pricelesspetrescue.org/adoptable-dogs/. I’m trying to incorporate the use of an additional file on that same page based on input from the user and only showing one or the other rather than both.
- The topic ‘Toggle Visibility of Separate Javascript Files on Same Page’ is closed to new replies.