日期:2014-05-17 浏览次数:20961 次
<html>
<head>
<script>
function mysubmit()
{
var str = document.getElementById("mydiv").innerHTML;
document.getElementById("content").value = str;
document.forms["myform"].submit();
}
</script>
</head>
<body>
在servlet里用request.getParameter("content")获取
<form id="myform" action="你的servlet路径" method="post">
<input type="hidden" name="content" id="content"/>
<div id="mydiv">qwerqwegqwegqweg</div>
<input type="button" onclick="mysubmit()" value="提交"/>
</form>
</body>
</html>