Another noob question. Help w/ javascript and a button closing a card

I wanna know how to make the button at the bottom of a card dismiss (or close) the card. I know no javascript (so fkn confusing for me).

Thanks so much!!


There are a couple of different ways doing this.

  1. You can use collapse function to hide the card. You can visit this page for more information about collapse.

  2. You can set the card to be display: none; when the button is .on('click', function(){...}) or onclick="...". For example:

Alright thanks. Only issue is I want the card to start out expanded then when I click Hide I want it to hide. When you go to the page at first, it shows Show but the card is expanded. PLEASE HELP!! I’m SO FREAKING CONFUSED. Thanks!!

Here’s the page (it’s the first card)

This is my code for that card:

this is because the default status of the card is not set to collapse. to fix this, you just need to add class collapse on collapsible-region.