With my append
(html) code I would like to be able to include <script></script>
Question: How can I use the <script></script>
will not allow me to add them.
As you can see at bottom of addContent() i need to include $("#page_code[' + content_row + ']").summernote({height: 300});
Script
<script type="text/javascript">
var content_row = <?php echo $content_row; ?>;
//$(document).ready(function() {
// $('#page_code').summernote({height: 300});
//});
function addContent() {
html = '<div id="content-row">';
html += '<div class="form-group">';
html += '<label class="col-sm-2">Page Content Name</label>';
html += '<div class="col-sm-10">';
html += '<input type="text" class="form-control" name="page_code[' + content_row + '][name]" placeholder="Page Content Name">';
html += '</div>';
html += '</div>';
html += '<div class="form-group">';
html += '<label class="col-sm-2">Page Content</label>';
html += '<div class="col-sm-10">';
html += '<textarea class="form-control" id="page_code[' + content_row + ']" name="page_code[' + content_row + '][code]" style="height: 300px;"></textarea>';
html += '</div>';
html += '</div>';
html += '<script>$("#page_code[' + content_row + ']").summernote({height: 300});</script>';
html += '</div>';
$('#content-row').append(html);
content_row++;
}
</script>