Im trying to make a html/css/javascript online editor so I create a textarea to write the code and Iframe to display it so this is the html :
<textarea id="code"></textarea>
<iframe id="output"></iframe>
<button id="submit-b">submit</button>
and this is the jquery code :
$("#submit-b").click(function(){
code = $("#code").val();
$('#output').contents().find('body').html(code);
});
it works to edit html and Css but not JavaScript, how can I do this?