CSS Bootstrap creating elements via javascript
<p>I am trying to create the following HTML code via javascript. For some reason, the bootstrap classes are not getting applied to the javascript code. Any help please?</p>

<pre><code>&lt;div class="form-group"&gt;
  &lt;label for="inputText" class="col-sm-2 control-label"&gt;Comments&lt;/label&gt;
  &lt;div class="col-sm-10"&gt;
     &lt;textarea class="form-control" rows = "3" id="inputText"  placeholder="Write your comments here"&gt;&lt;/textarea&gt;
  &lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>I m trying to create this HTML using javascript as below. Not sure what I am missing.</p>

<pre><code>var div = document.createElement('div');
div.class = 'form-group';
var label = document.createElement('label');
label.class = 'col-sm-2 control-label';
label.innerHTML = 'Comments';
label.for = 'inputText';
var div1 = document.createElement('div');
div1.class = 'col-sm-10';
var commentText = document.createElement('textarea');
commentText.class = 'form-control';
commentText.id = 'inputText';
commentText.rows = '3';
commentText.placeholder = 'Write your comments';
div.appendChild(label);
div1.appendChild(commentText);
div.appendChild(div1);
</code></pre>