<script type="text/javascript">
function change() {
document.getElementById('target').getElementsByTagName('html').getElementsByTagName('body').innerHTML = document.getElementById('src').value;
}
</script>
<textarea id="src" onchange="change();"></textarea><br/>
<iframe id="target"></iframe>
This is my code and I don’t understand why it isn’t working. No jQuery please. I know things like this exist for example htmledit squarefree I have tried frame instead of iframe and that hasn’t worked either
Is this what you are looking for? First I am using
onkeyupon the textarea, I don’t think that textarea has anonchangeevent. Then I am grabbing the iframe using two different methods depending on the browser and then populating the iframe with the text from the textarea.