Why scripts at the end of body tag
I know this question was asked many times, but I haven't found answer. So why its recommended to include scripts at the end of body tag for better rendering? From Udacity course https://www.udacity.com/course/ud884 - rendering starts after DOM and CSSOM are ready. JS is HTML parse blocking and any script starts after CSSOM is ready. So if we got: <html> <head> <meta name="viewport" content="width=device-width,initial-scale=1"> <title>CRP</title> <link rel="stylesheet" href="styles.css"> </head> <body> <!-- content --> <script src="script.js"></script> </body> </html> CRP would be: CSSOM ready