I am trying to build a CMS using Symfony in which I am trying to use Vanilla JS instead of jQuery. I am displaying a modal with some info on page load.
If I do $("#companies").modal(); the bootstrap modal is displayed correctly.
Until now I thought let companies = $("#companies"); and let companies = document.getElementById('companies'); were equivalent. But when I tried to call the modal function on the element returned by Javascript getElementById, it gave me error modal() is not a function.
How can I call the Bootstrap modal function using an element returned by getElementById function? Thanks.