I have a textarea to display the HTML content from the database. Here my code is:
<script type="text/javascript">
//<![CDATA[
$('#cont').html('<?php echo $cont['0']['desc'];?>');
$('#name').html('<?php echo $cont['0']['name'];?>');
//]]>
</script>
<textarea name="cont" id="cont"></textarea>
<textarea name="name" id="cont"></textarea>
When I try to load content dynamically, #name
is working perfectly but the #cont
shows an console error like:
Uncaught SyntaxError: Invalid or unexpected token
This is the content I am attempting to load in to the #cont
<h3 style="box-sizing: border-box; font-family: kozgopro-medium; font-weight: 500; line-height: 1.1; color: #014d7e; margin: 0px; font-size: 24px; padding: 5px 0px;">Coconut Oil</h3>
<h5 style="box-sizing: border-box; font-family: kozgopro-medium; font-weight: 500; line-height: 1.1; color: #0091f0; margin: 0px; font-size: 16px; padding: 10px 0px 5px;">Extra Virgin / Premium</h5>
Thanks for your answers