when dom is ready jquery code example
Example 1: dom ready js
document.addEventListener("DOMContentLoaded", function() {
// code
});
Example 2: document jquery
$(function(){
// equal to $( document ).ready(function() {
});
document.addEventListener("DOMContentLoaded", function() {
// code
});
$(function(){
// equal to $( document ).ready(function() {
});