I am trying to built a embed HTML system in where anyone can copy and paste code snippet in his website to display that.For this I have written requied code in the jquery section . I want to pass that code to a specific div so that that code is run as source code.
jquery part :
$(document).on("click", "#embedLink", function () {
var textArea=$("#textArea");
var url = $('#headerInput').val();
$("#framInput").val(url);
var iframe =document.getElementById('ifrm');
var html= '<iframe id="ifrm" src="'+url+'"width="100%" height="600" frameborder="0"disable></iframe>';
textArea.append(html);
});
blade template:
<div name="" id="textArea">
</div>
I want to pass the html value in the div(id="textArea") element.And then I want to show like that....
<iframe id="ifrm" src="'+url+'"width="100%" height="600" frameborder="0"disable></iframe>
How can do that?