Code
Execute
<!DOCTYPE html> <html> <head> <title>Wikitechy defer attribute</title> </head> <body> <script src="script.js" defer> </script> <p>The script is executed before the paragraph exists.</p> <p id="p1">Wikitechy</p> <p> This way the script can request information from the paragraph.</p> </body> </html>
Result