Q:

Divi : Hide Button when clicked

I'm a novice in jQuery coding, and I need help with my code. 
I have a button that allows me to reveal a hidden section on my website, but at the moment the button remains even though I want him to disappear.
My website is built with Wordpress and Divi.
With the following code, you will have my latest attempt with the hide/show value in CSS.
<style type="text/css">
.rv_button.closed:after {content:"";}
.rv_button.opened:after {content:"";}
.hide {display:none;}
.show {display:block;}
</style>

<script type="text/javascript">
jQuery(document).ready(function() {
  jQuery('#reveal').hide();

  jQuery('.rv_button').click(function(e) {
    e.preventDefault();
    jQuery("#reveal").slideToggle();
    jQuery('.rv_button').toggleClass('opened closed');
  });
});

</script>

If you want to see what it looks like, you can see the example here: https://divinotes.com/reveal-a-hidden-divi-section-row-or-module-on-button-click/

A:

Just add $(this).hide() in your click function.
<script type="text/javascript">
    jQuery(document).ready(function() {
        jQuery('#reveal').hide();

        jQuery('.rv_button').click(function(e) {
            e.preventDefault();
            jQuery("#reveal").slideToggle();
            jQuery('.rv_button').toggleClass('opened closed');

            // Hide button
            $(this).hide()
        });
    });
</script>

