日期:2014-05-16 浏览次数:20343 次
<!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>
<title></title>
<script src="jquery.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
$("#test").bind("input propertychange", function () {
alert();
/*if ($("#test").children().eq(0).get(0).tagName != 'P') {
j.empty();
var o = $("<p style=" margin:5px 0px;"><br></p>").appendTo(j);
}*/
});
});
</script>
</head>
<body>
<div id="test" contenteditable="true" style="height:200px; word-break:break-all; border:1px solid black; background-color:White; width:400px ;">
<p style=" margin:5px 0px;"><br/></p>
</div>
</body>
</html>
var o = $("<p style=' margin:5px 0px;'><br></p>").appendTo(j);
j.empty(); var o = $("<p style=" margin:5px 0px;"><br></p>").appendTo(j);