As long as you do not delete or backspace over where the unseen font tags are. This works in IE and Opera9, not in FF:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
#theTxt {
border:1px solid gray;
width:400px;
}
</style>
<script type="text/javascript">
function loadTxt(){
document.getElementById('theTxt').innerHTML=document.getElementById('theDiv').innerHTML//.replace(/<[^>]*>/g, '')
}
function loadDiv(){
document.getElementById('theDiv').innerHTML=document.getElementById('theTxt').innerHTML
}
onload=loadTxt;
</script>
</head>
<body>
<div id="theDiv"><font face="arial">aaaaaaaaaaaaaaa</font><font face="serif">bbbbbbbbbb</font><font face="arial">ccccccccccccc</font></div>
<div contenteditable id="theTxt"></div>
<input type="button" onclick="loadDiv()" value="Update">
</body>
</html>
Bookmarks