Trying to make dynamically created element draggable
I'm trying to create a dynamic input element that is draggable. Now the problem is I create an element but when I u开发者_JS百科se something like
$("#in"+index.toString()).draggable({cancel:true});
after I append it to the container div, it's not working. Basically it's not working for the dynamically created input element of a certain id. Here's the code and please feel free to point out problems. I could really use some help on this one. Thanks!
http://jsfiddle.net/ithril/hRCun/5/
The problem is that you are creating a new element that is not bound to the UI functions. I would suggest using clone(true,true)
and then changing the parameters of the cloned element as need be. You can learn more about clone here. http://api.jquery.com/clone/
精彩评论