Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: No info about the collapse plugin supporting checkboxes as toggles #39728

Open
carlosmintfan opened this issue Mar 4, 2024 · 0 comments · May be fixed by #39767
Open

Docs: No info about the collapse plugin supporting checkboxes as toggles #39728

carlosmintfan opened this issue Mar 4, 2024 · 0 comments · May be fixed by #39767

Comments

@carlosmintfan
Copy link

https://getbootstrap.com/docs/5.3/components/collapse/ only tasks about buttons and <a> elements as toggles. However, using checkboxes also works fine, like in the following code provided by ChatGPT. Therefore, it should be pointed out in the docs that you can also use checkboxes as collapse toggles.

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css">
    <title>Checkbox Beispiel</title>
</head>
<body>

<div class="container mt-5">
    <div class="form-check">
        <input class="form-check-input" type="checkbox" id="hideCheckbox" data-bs-toggle="collapse" data-bs-target="#contentToHide" checked>
        <label class="form-check-label" for="hideCheckbox">
            Hide things
        </label>
    </div>

    <div class="collapse mt-3" id="contentToHide">
        <p>Dies ist der Inhalt, der versteckt werden soll.</p>
    </div>
</div>

<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>

</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: To analyze
Development

Successfully merging a pull request may close this issue.

2 participants