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).on('click','#customSwitches', function(event){
            document.getElementById("table").innerHTML = `{% include 'app/table.html' %}`;
Back to Top