【发布时间】:2014-04-26 13:55:24
【问题描述】:
我有以下代码:
<div>
<textarea id="tinyeditor" name="description_evenement"></textarea>
<iframe width="584" height="175">
#document
<html>
<head>
<link href="custom.css" rel="stylesheet"></link>
</head>
<body id="editor" contenteditable="true">
Hello world!
</body>
</html>
</iframe>
</div>
我需要做的是用值“Hello world!”填充文本区域。在提交之前使用 javascript,我使用了以下代码,但它不起作用:
<script type="text/javascript">
function replace(){
var content = document.getElementById('editor').innerHTML;
document.getElementById("tinyeditor").value = content;
}
</script>
任何帮助将不胜感激
【问题讨论】:
-
你得到bodyin内容的innerHtml了吗?
-
不,我什么都没得到
标签: javascript html iframe textarea