Jump to content

TANDEROID

Neophyte
  • Posts

    1
  • Joined

  • Last visited

Information

  • Sex
    мужской

TANDEROID's Achievements

Explorer

Explorer (1/14)

0

Reputation

  1. Доброго времени суток, форумчане! Столкнулся со следующей проблемой, а скорее вопросом к опытным разработчикам. Сам вопрос в том, что я не могу понять почему так работает: <!DOCTYPE HTML> <html> <head> </head> <body> <main> </main> <script> var body = document.body; var main = document.getElementsByTagName("main")[0]; main.innerHTML += "Hello"; body.innerHTML += "World!"; </script> </body> </html> А так нет: <!DOCTYPE HTML> <html> <head> </head> <body> <main> </main> <script> var body = document.body; var main = document.getElementsByTagName("main")[0]; body.innerHTML += "World!"; //переставил строку на другое место main.innerHTML += "Hello"; </script> </body> </html>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy