<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>简单的写了个</title>
<script type="text/javascript">
var number = 0;window.onload = function () {
var ifr = frames[0];
ifr.document.designMode = 'on';
ifr.document.body.innerHTML = '测试一下';
ifr.document.addEventListener('mouseup', function () {
document.getElementById('status').innerHTML = 'MSG:' + (number ++)
+ '<br \/>必须要addEventListener';
}, false);
};
</script>
</head>
<body>
<div style="position:absolute; width:100px; height:100px; background-color:#999999; left:100px; overflow:hidden;">
<br /><input id="wc" type="text" value="#FF0000" />
<br /><br /><input type="button" value="点我给它着色" title="点我给它着色" onclick="
var ifr = frames[0]
    ifr.document.execCommand('hilitecolor', false, document.getElementById('wc').value);
    ifr.focus();
" />
</div>
<iframe width="500" height="200"></iframe>
<div id="status"></div>
</body>
</html>