DEV Community 👩‍💻👨‍💻

DEV Community 👩‍💻👨‍💻 is a community of 966,904 amazing developers

We're a place where coders share, stay up-to-date and grow their careers.

Create account Log in
Cem coduroglu
Cem coduroglu

Posted on

Data-Toggle Doesn't work! Help please.

Hey guys, i just make a button with my udemy teacher. I did the same think as he did. But in my page it doesn't work. What am i missing?
I just created a button but when i click on it the text doesn't opening.

Thank you so much for your reply !

**<body class="w-75 mx-auto my-4">

    <p>
        <a href="#content" class="btn btn-dark bg-warning" data-toggle="collapse">Read More</a>
    </p>

    <div id="content" class="collapse">
        <h2>Lorem ipsum dolor sit.</h2>
        <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Deleniti sint nobis vero quaerat ad ex. Et,
            pariatur. Nemo, impedit. Eligendi exercitationem ea provident eos eum nesciunt deleniti quos debitis
            numquam?</p>
    </div>
**



    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"
        integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p"
        crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.10.2/dist/umd/popper.min.js"
        integrity="sha384-7+zCNj/IqJ95wo16oMtfsKbZ9ccEh31eOz1HGyDuCQ6wgnyJNSYdrPa03rtR1zdB"
        crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.min.js"
        integrity="sha384-QJHtvGhmr9XOIpI6YVutG+2QOK9T+ZnN4kzFN1RtK3zEFEIsxhlmWl5/YESvpZ13"
        crossorigin="anonymous"></script>
</body>

</html>

Enter fullscreen mode Exit fullscreen mode

Top comments (2)

Collapse
 
premjeet profile image
PremJeet • Edited on

I see that you are using bootstrap..Are you reading the docs or just following the teacher?
Cause I see you are missing some stuff that is needed in button attributes

Collapse
 
cem_coduroglu profile image
Cem coduroglu Author

I was following the teacher. But i think i figure it out brother. I guess the way that he uses its like timeout. So i check on w3school

🌚 Life is too short to browse without dark mode