Skip to content
Advertisement

Prioritise a div or image to load first

Here’s some example code, I would like to prioritise “div1” to load before anything else does.

JavaScript

Advertisement

Answer

Just via HTML you cannot prioritize what will load first on your web page.

The page loads from the Top to Down approach, which first <HEAD> and its content, then <BODY> and its content.

If you like to render a page according to your need you need to use JavaScript.

Below sample code below does the same.

JavaScript
JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement