62,051
社区成员
发帖
与我相关
我的任务
分享
<iframe id="message" marginwidth="0" marginheight="0" width="100%" height="250px"
style="border-style: solid; border-width: 1px; border-color: Gray; border-bottom-width: 0px;"
frameborder="0"></iframe>
<input name="HtmlEditor1" type="hidden" id="HtmlEditor1"
runat="server" />
<script language="javascript" type="text/javascript">
function initframe()
{
message.document.designMode="On";
message.document.body.onkeydown=function setContent()
{
document.getElementById("HtmlEditor1").value = message.document.body.innerHTML ;
}
}
window.onload=initframe;
</script>
<script language="javascript" type="text/javascript">
function initframe() {
debugger
message.document.designMode = "On";
message.document.onkeyup = function setContent() {
document.getElementById('HtmlEditor1').value = message.document.body.innerHTML;
}
}
window.onload=initframe;
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
<script language="javascript" type="text/javascript">
function initframe() {
debugger
document.getElementById('message').document.designMode="On";
document.getElementById('message').document.body.onkeydown = function setContent() {
document.getElementById('HtmlEditor1').value = document.getElementById('message').document.body.innerHTML;
}
}
window.onload=initframe;
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<iframe id="message" marginwidth="0" marginheight="0" width="100%" height="250px"
style="border-style: solid; border-width: 1px; border-color: Gray; border-bottom-width: 0px;"
frameborder="0"></iframe>
<input name="HtmlEditor1" type="hidden" id="HtmlEditor1" runat="server"/>
<input name="HtmlEditor2" type="button" id="HtmlEditor2" value="GetValue" onclick="alert(document.getElementById('HtmlEditor1').value)"/>
</div>
</form>
</body>
</html>
<script language="javascript" type="text/javascript">
function initframe() {
debugger
document.getElementById('message').document.designMode="On";
document.getElementById('message').document.body.onkeydown = function setContent() {
document.getElementById('HtmlEditor1').value = document.getElementById('message').document.body.innerHTML;
}
}
window.onload=initframe;
</script>
public string Content
{
get { return HtmlEditor1.Value.ToString(); }
set { HtmlEditor1.Value = value; }
}