我正在尝试在 iframe 内的 textarea 中写入文本时显示文本。因此,它将像通过外部页面一样显示。
当前代码在 id 为“div”的 div 中显示输入。但是我想在 iframe 中显示它,这可能吗?
我目前的代码是:
<script language='javascript'>
function hot(){
document.getElementById("div").innerHTML=document.getElementById("text").value
}
window.onload = function() {hot();};
</script>
<textarea id="text" onKeyUp="hot();"></textarea>
<div id="div"></div>