call modal by id href
snippet in html

bootstrap 4 hide modal via javascript

user9572

$('#myModal').modal('hide')

how to show bootstrap modal

user3377

<script>
    var myModal = new bootstrap.Modal(document.getElementById('ModalID'))
    myModal.show()
</script>

call modal by id href

user8111

<a href="!#" data-toggle="modal" data-target="#login">
</a>