Editor 如何检索YUI富文本编辑器';通过Javascript访问内容?

Editor 如何检索YUI富文本编辑器';通过Javascript访问内容?,editor,yui,Editor,Yui,我对document.getElementById('editor').value有问题,因为我无法获取该值。YUI编辑器的textarea不是正常的textarea <script> function viewValue { alert(document.getElementById('editor').value); } </script> 函数视图值 { 警报(document.getElementById('editor').value); } 文本区

我对
document.getElementById('editor').value有问题,因为我无法获取该值。YUI编辑器的textarea不是正常的textarea

<script>
function viewValue
{
   alert(document.getElementById('editor').value);
}
</script>

函数视图值
{
警报(document.getElementById('editor').value);
}
文本区域:

<div class="editor" > 
    <textarea id="editor" name="editor">            
    </textarea>
</div>

文档:


//将HTML放回文本区域
oEditor.saveHTML();
//var html现在将包含textarea的内容
var html=oEditor.get('element').value;
警报(html);
<script>
    //Put the HTML back into the text area
    oEditor.saveHTML();
    //The var html will now have the contents of the textarea
    var html = oEditor.get('element').value;
    alert(html);
</script>