B
B
Berkutman2020-04-27 20:14:32
JavaScript
Berkutman, 2020-04-27 20:14:32

How to show hidden elements using js in bootsrap 4?

<div class="container" id="some_block">
    <div class="row">
<p> TEXT-SHOW </p>

    </div>
    <div class="row d-none">
<p> TEXT-HIDDEN</p>

    </div>  
</div>
<button id="show_more">Показать еще</button>


$("#show_more").on("click", function() {
        $("#some_block").removeClass(".d-none");
    });


What is my problem? I click on the button and does not display the hidden block

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Igor, 2020-04-27
@Berkutman

Use the standard Collapse component , it is described in great detail on the official documentation page. Your problem is that you are reinventing the wheel when you have already invented the motorcycle, before I also did this very often, I do not advise.

I
Ilkhomjon Matazimov, 2020-04-27
@mr_qpdb

$('#show_more').addEventListener('click', () => {
    $('#some_block').removeClass('d-none')
})

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question