Adding multiple DIV elements using functions with JavaScript
<p>I am kind of new to JS and that is why I am asking for some help with this. I want to create multiple nested div elements like this: </p>

<pre><code>&lt;div&gt;
  &lt;div&gt;

    &lt;div&gt;
    &lt;/div&gt;

    &lt;div&gt;
    &lt;/div&gt;

  &lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>I already did create them but my mentor at work wants me to use functions so that it would make
the code more readable.</p>

<p>I already have tried to create multiple functions for every each element that is created, but he told me that he doesn't like it and want's me to try another way. So that is why I am asking for some help.
I already tried this (it is just a sample don't have permission to show actual code... company rules):</p>

<pre><code>        function firstContainerCreator(){

            firstContainer= doc.createElement("div");
        }

        function innerContainerCreator(){

            innerContainer= doc.createElement("div");
        }

        function innerContainer_imgCreator(){

            innerContainer_img= doc.createElement("div");


        }

        function innerContainer_paragraphCreator(){

            innerContainer_paragraph= doc.createElement("div");

        }
</code></pre>

<p>Any help is appreciated.</p>
