Skip to content
Advertisement

Is there a way to load html generated with javascript in a specific div?

I have a javascript function that generates some html content. However the event listener i’m using load the content at the end of the page.*I’d like it to be loaded in a specific div.

JavaScript

I also tried the onload attribute in the div … but stll doesn’t work:

JavaScript

The createForm function:

JavaScript

Any idea ? Thanks a lot from France !

Advertisement

Answer

Found the answer !

basically, as everyone said, a “return” was missing ! Just needed to figure out where to place !

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