I am using this code to insert text but now i want to add html code in textfield as well.
<input type="button" class="btn btn-danger btn-flat" value="Bitcoin" onclick="insertText('input-comment', '<iframe src="invoice.php?address=3NUcGsurfneJxMC3vb5hWwgjg5ytTP9daB&amount=10&id=109" width="800px" height="800px" frameborder="0px"></iframe>');">
It is working fine when i put text in it but doesn't work any more when i add this html code. This html code(iframe code) should automatically inserted in textarea on button click.
My js
<script type="text/javascript">
function insertText(elemID, text)
{
var elem = document.getElementById(elemID);
elem.innerHTML += text;
}
</script>
insertText?<script type="text/javascript"> function insertText(elemID, text) { var elem = document.getElementById(elemID); elem.innerHTML += text; } </script>