I have a code like this:-
<div id="one">Some HTML code</div> <div id="two">Some HTML code</div> <div id="three">Some HTML code</div> <div id="four">Some HTML code</div> <div id="five">Some HTML code</div>
As you can see every div container has a different id. So what I want to create from above is this dynamically
<div id="something"> <div id="one">Some HTML code</div> <div id="two">Some HTML code</div> <div id="three">Some HTML code</div> </div> <div id="four">Some HTML code</div> <div id="five">Some HTML code</div>
I want to create it using JavaScript or Jquery. So can anybody help.
Thanks
You can use the wrapAll function to do this.
For more information, refer http://api.jquery.com/wrapAll/