How to refresh an id using innerHTML when a button is clicked

I have the following JS code and I am trying to reload the content of the innerHTML not just insert it as it is.

Here is the script

 <button value="true" id="customSwitches">Button</button>

<script type="text/javascript">
    $(document).ready(function(event){
        $(document).on('click','#customSwitches', function(event){
            event.preventDefault();
            document.getElementById("table").innerHTML = `{% include 'app/table.html' %}`;
                },
            });
        });
</script>      
Back to Top