This is a complex request because it involves multiple interacting components (Bootstrap modals, JavaScript event handli
This is a complex request because it involves multiple interacting components (Bootstrap modals, JavaScript event handling, and an accordion structure).
To get the best, most accurate code from Gemma 4, you need to be highly specific and define the *behavior* rather than just listing the components.
Here are three options, depending on how much technical detail you want to provide to the AI.
---
Use this prompt if you want the most robust, complete, and technically accurate code output (HTML, CSS, and JavaScript).
**Prompt to Use:**
> "I need a complete, functional web component using Bootstrap 5. The component must contain the following elements and behaviors: > > **1. Structure:** > * An **Accordion** element that contains a full article (I will provide the article text later). > * A primary **Modal** (Modal A) that is triggered by a button within the accordion content. > * A secondary **Modal** (Modal B, the 'Thank You' modal). > > **2. Behavior Requirements:** > * **Auto-Open:** Upon page load, Modal A must automatically open. > * **Close Button Logic:** When the user clicks the close button (X) on Modal A, the modal must **not** simply close. Instead, the JavaScript must intercept this click, hide Modal A, and immediately display Modal B ('Thank You'). > * **Content:** The article content must be placed within the accordion structure. > > Please provide the full code, including the necessary HTML structure, Bootstrap CSS links, and the required JavaScript/jQuery to handle the modal switching logic."
***
Use this if you are unsure about the exact JavaScript implementation and just want the AI to figure out the best way to make the interaction work.
**Prompt to Use:**
> "Using Bootstrap 5, please generate the code for a single page section. This section must feature an accordion containing a full article. Within the accordion, there must be a button that triggers a primary modal (Modal A). This primary modal must open automatically when the page loads. Crucially, when the user clicks the close button on Modal A, the modal must transition to displaying a second modal (Modal B, the 'Thank You' modal) instead of