capture the response of a bootstrap 4 modal and save in javascript variable code example Example: html data-target modal $('#myModal').modal('show')