[jQuery] Draggable function for new created div..

[jQuery] Draggable function for new created div..


Hi all ,
I have a poroblem with new created div.. draggable function is not
working.
normally draggable div is working successfull like this code.
<html>
<head>
<script src="js/dragYeni/jquery.js"></script>
<script type="text/javascript" src="js/iutil.js"></script>
<script type="text/javascript" src="js/idrag.js"></script>
</head>
<body>
<div id="parentElem">
<div id="insideParent"></div>
</div>
<script type="text/javascript">
jQuery(document).ready(
function()
{
jQuery('#insideParent').Draggable(
{
zIndex:     1000,
ghosting:    false,
opacity:     0.7,
containment : 'parent'
}
);
}
);
</script>
</body>
</html>
-------------------------
*** But the problem is starting when I create a new div..
I can add a new div, there is no problem there.. but its not
draggable..
<html>
<head>
<script src="js/jquery.js"></script>
<script type="text/javascript" src="js/iutil.js"></script>
<script type="text/javascript" src="js/idrag.js"></script>
<script>
function addEvent() {
var ni = document.getElementById('insideParent');
var divIdName = "myNewDiv";
var newdiv = document.createElement('div');
newdiv.setAttribute("id",divIdName);
newdiv.innerHTML = "test div its draggable";
ni.appendChild(newdiv);
}
</script>
</head>
<body>
<a href="javascript:;" onclick="addEvent();" > add new div </a>
<div id="parentElem">
<div id="insideParent"></div>
</div>
<script type="text/javascript">
jQuery(document).ready(
function()
{
jQuery('#myNewDiv).Draggable(
{
zIndex:     1000,
ghosting:    false,
opacity:     0.7,
containment : 'parent'
}
);
}
);
</script>
</body>
</html>
I need help..
thanks alot..