How to first load/render HTML/CSS and then Javascript? on a page of website/web-app?
So page loading should not seems slow because of javascript. I read about defer and async but not much clear on this topic. Is to keep javascript at bottom enough?
I want to load html/css first because the javascript i added is for further interactions.
For example I have a buttton which do something using javascript. I want to related javascript file only if user click/press that button otherwise not.
I don't want to preload the JavaScript because it's not necessary it will be used or not until it's required
 
     
     
     
    