You probably need to provide a little more information - html itself would be very useful, but I'm going to assume that reportis the identifier of the text field that you need to clear.
If this is a normal text area, your code really should work.
( ), openwysiwyg, , iFrame HTML-. iFrame.
, .
, , iFrame: http://www.bennadel.com/index.cfm?dax=blog:1592.view
example.html, openwysiwyg:
<script type="text/javascript">
WYSIWYG.attach('textarea1');
WYSIWYG.attach('textarea2', full);
WYSIWYG.attach('textarea3', small);
function getIFrameDocument( id )
{
var iframe = document.getElementById(id);
if (iframe.contentDocument) {
return iframe.contentDocument;
} else if (iframe.contentWindow) {
return iframe.contentWindow.document;
} else if (iframe.document) {
return iframe.document;
} else {
return null;
}
}
function clearcontents()
{
getIFrameDocument('wysiwygtextarea1').body.innerHTML = '';
}
</script>
- ( div):
<div style="width:120px;height:20px;background:#ff0000;text-align:center;display:block;" onclick="clearcontents();">Clear!</div>
, wysiwyg. iFrame.
Firefox, . iFrame, -, , , :)