i am doing the jquery draggable it work fine in the initial case but it does not work when a new same div is created with jswhat is the actual problem with my code please help me http://galtech.org/testing/drag_new.php Drag me old worked fine But new draggable div is created with New element (red anchor in bottom ) it does not have draggable property
<script>
function shw()
{
$("#name").html('<div id="draggable">Drag me new</div>');
}
$(document).ready(function() {
$( "#draggable" ).draggable({ cursor: 'move', containment: '#name', opacity: 0.35 });
});
</script>
</head>
<body >
<div id="name" style="background:#9999FF; height:500px; width:500px;">
<div id="draggable">Drag me old</div>
</div>
<a onClick="shw();" style="background-color:#FF0000; cursor:pointer;">New element</a>
</body>
</html>