Mukesh Goyal Mukesh Goyal - 3 months ago 10
jQuery Question

contenteditable is not working with dragable feature

In this code

contenteditable
is not working, what mistake did I make here?

I want more than one
contenteditable
element in this div.

<!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>



Answer
<!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>