How to Append a div with javascript inside

Posted by Damathryx on Stack Overflow See other posts from Stack Overflow or by Damathryx
Published on 2013-10-20T15:19:55Z Indexed on 2013/10/20 15:54 UTC
Read the original article Hit count: 281

Filed under:
|
|
|
|

I have this

<div id="inprog_table">
</div>

I tried this to insert

  var div = document.getElementById('inprog_table');
  div.innerHTML = div.innerHTML+
      "<div class='row'>
              <div class='col-xs-7'>
                 "+ $(".row.active .col-xs-7 p:first-child").text()+"  
              </div>
              <div class='col-xs-2'>
                  "+ $(".row.active .col-xs-7 p:last-child").text()+"
              </div>

              <div class='col-xs-2'>
                1
              </div>"

inside inprog_table div. I know it's really wrong, but I don't know how to append all of this.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery