Mencari Sesuatu ?

Jumat, 09 Desember 2022

Vanilla JS like jquery document.ready

 Default can use this :



document.addEventListener('DOMContentLoaded', function () {

  // do something here ...

}, false);



on fully load use this :



window.addEventListener('load', function () {

  // do something here ...

}, false);







credit to source : 

https://www.codeinwp.com/snippets/jquery-document-ready-in-vanilla-javascript/

Tidak ada komentar:

Posting Komentar