create DOMs programmatically : <p>After calling an API, I can get an array of data.
For example, I can get a list of objects, each object contains 1 unique id, 1 author, 1 article, 1 picture...etc.</p>

<p>I created the div template already. There are many div and bootstrap classes inside.</p>

<pre><code> &lt;div class="col-sm-4" id="test"&gt;
    &lt;div class="box" style="padding-bottom: 10px;"&gt;
        &lt;div class="row"&gt;
            &lt;div class="col-xs-12"&gt;
                    &lt;div class="col-xs-12"&gt;
                        &lt;video class ="col-xs-12" controls&gt;
                          &lt;source src="../data.mp4" type="video/mp4"&gt;
                        Your browser does not support the video tag.
                        &lt;/video&gt;
                    &lt;/div&gt;
                &lt;div class="col-xs-12" style="margin-top: 10px;"&gt;
                    &lt;div class="col-xs-12" style="margin-top: 5px"&gt;
                        &lt;div class="avatar col-xs-2"&gt;
                            &lt;img src="../data.jpg"&gt;
                        &lt;/div&gt;
                        &lt;div class="col-xs-6"&gt;
                        &lt;p class="pull-left"&gt; data(Author) &lt;/p&gt;
                        &lt;/div&gt;
                        &lt;div class="col-xs-2"&gt; 
                        &lt;button&gt;data&lt;/button&gt;
                        &lt;/div&gt;
                        &lt;div class="col-xs-2" style="padding: 0"&gt; 
                        &lt;button&gt;data&lt;/button&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 want to create DOMs that represent each object, and style them using bootstrap and css. How do I put the corresponding data in the corresponding places on the template above?</p>

<p>Also, there are buttons inside the root div that associate with the unique id with the root div. The buttons has comments function. When the button is onclick, the article id (unique) will be sent to the API and thus the corresponding comments will be displayed. </p>

<p>Thanks in advance.</p>
