Question regarding making multiple buttons changing what embed shows up on one same HTML page
Briefly

To create a game hub page with multiple buttons that each launch an embedded game, you can use JavaScript to manage the buttons' click events. Each button can correspond to a unique game link, stored in an array. Upon clicking a button, JavaScript will update the source of an iframe element on the page to display the selected game. This approach minimizes clutter from hardcoding all game links directly into HTML and provides a cleaner user experience, however, be aware that engaging with third-party sites may risk blocking by your school's administration.
To create a single-page game hub that determines which game to embed based on button clicks, you'll need a combination of JavaScript event handling and DOM manipulation.
You can use an array of game URLs mapped to button IDs or titles, then based on the button pressed, dynamically update the embed iframe's source.
When a button is clicked, the associated JavaScript function can change the src attribute of an iframe element, effectively loading the selected game into the same page.
While you can minimize the number of direct links in your code, the embed itself still communicates with the game server, necessitating careful management of access.
Read at SitePoint Forums | Web Development & Design Community
[
|
]