0

Why does my html code go before my JavaScript code

In my function hit I have a TextNode and a html element I want to have my html after my JavaScript but its not working. Please help https://code.sololearn.com/W1bs3sJGx67s/?ref=app

18th Jan 2019, 4:51 AM
Trevor
Trevor - avatar
2 Answers
+ 2
your code was hiding a div at the top so it pushed it down..so i added a p tagged id "fix" at the top before main1..since your code was hiding after that. i also moved the closing body tag to the bottom. i also added a variable in js to get the id "fix" from the new div i made so the appendchild can be injected in there before the js can run. you can find it above your mnh variable. after the mnh var..i put div.appendChild (mnh) which will place the mnh var in the p tagged "fix" in the html its late i hope i explained that clearly
18th Jan 2019, 6:38 AM
Jason Kennedy
18th Jan 2019, 6:36 AM
Jason Kennedy