SVG elements are created differently than html elements. Using vanilla js you create html elemnts using,
var elem = document.createElement('div');
While you create svg you use following syntax,
var elem = document.createElementNS("http://www.w3.org/2000/svg", "text");
I did quick search to see if jQuery supports creating svg elements but didn't find anything. Here is how you can create your element while still using jQuery. Also, from wherever you forked this demo, it is using really old version of Draggable.