Say I have a div as:
<div id="myDiv"> </div>
I have a GQuery object which I got using
GQuery mydiv = GQuery.$("#myDiv");
Using this, I want to create a new parent which wraps this div element inside it. For example, if the parent is another div, following is what I want:
<div id = "parentDiv">
<div id="myDiv"> </div>
</div>
Though this sounds like a simple thing to do, I am not able to get the desired result.
Note: I have tagged JQuery for this question as well since if a simple method for the same exists in JQuery, it is probable that it would exist in GQuery as well.
I think you want use wrap():
I don't know GQuery, it's based on jQuery.
I read some documentation and I'm not sure if your syntax should be:
or something else. Just be sure you have good syntax and use
wrap()
.