Which img is gonna be loaded first ?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Which img is gonna be loaded first ??

<img id="myimg" src="orange.png" alt="" /> <script> var el = document.getElementById("myimg"); el.src = "apple.png"; </script> **************************** In this code if we but the script tag in the end , and as u know the html elements will be loaded first , then the js code will be loaded . So which img will appear first ?? Or just the second one will appear ??

20th Apr 2019, 8:47 PM
Let Name = Abdulrahman;
3 Answers
+ 3
Have you tried it out?
20th Apr 2019, 8:50 PM
Mind To Machine 💻🕆
Mind To Machine 💻🕆 - avatar
0
lol
25th Mar 2021, 8:50 AM
kumanan
kumanan - avatar
- 1
20th Apr 2019, 8:58 PM
Let Name = Abdulrahman;