Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to add defer attribute using js

window.addEventListener('load', (event) => {
  var fbChatScript = document.querySelector('#facebook-jssdk');
  fbChatScript.setAttribute('defer', '');
});
 
PREVIOUS NEXT
Tagged: #add #defer #attribute #js
ADD COMMENT
Topic
Name
3+4 =