so I was trying to dynamically create an element in Jquery, and then wrap that in a more simplistic element using jquery wrap. I tried the following, and it did not work:
jQuery('<div />',{
"class":"b",
text:"testing"
}).wrap('<div class="red" />');
jsfiddle
then after a search, I cam across this question, which seemed to be what I was looking for.
Unfortunately that code is for placing inside the created element rather than wrapping the created one. I tried messing around with it, but as of now it seems to me that there is no way to simply wrap a Jquery
created element.
Is this a bug in the function? Or am I missing something?