jquery - How to wrap an element as parent of a known element using GQuery -


say have div as:

<div id="mydiv"> </div> 

i have gquery object got using

gquery mydiv = gquery.$("#mydiv"); 

using this, want create new parent wraps div element inside it. example, if parent div, following want:

<div id = "parentdiv">     <div id="mydiv"> </div> </div> 

though sounds simple thing do, not able desired result.

note: have tagged jquery question since if simple method same exists in jquery, probable exist in gquery well.

i think want use wrap():

gquery mydiv = gquery.$("#mydiv").wrap('<div id="parentdiv" />'); 

i don't know gquery, it's based on jquery.


i read documentation , i'm not sure if syntax should be:

gquery mydiv = $("#mydiv").wrap('<div id="parentdiv" />'); 

or else. sure have syntax , use wrap().


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -