how to replace jquery document.ready code example Example: js vanilla dom ready document.addEventListener("DOMContentLoaded", function() { // code });