在此代码中contenteditable
无效,我在这里犯了什么错误?
我想在这个div中有多个contenteditable
元素。
<!doctype html>
<html lang="en">
<head>
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css">
<style>
#element { width: 150px; height: 150px; padding: 0.5em; }
</style>
</head>
<body>
<div style="width:500px;height:500px;border:1px solid;">
<div id="element" class="ui-widget-content">
<p contenteditable='true' style="border:1px solid;">Drag me around</p>
</div>
</div>
</body>
</html>
答案 0 :(得分:1)
<!doctype html>
<html lang="en">
<head>
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css">
<style>
#element { width: 150px; height: 150px; padding: 0.5em; }
</style>
</head>
<body>
<div style="width:500px;height:500px;border:1px solid;">
<div id="element" class="ui-widget-content">
<p contenteditable='true' style="border:1px solid;">Drag me around</p>
</div>
</div>
</body>
</html>