I want to insure that all of my fieldsets have a <div> tag enclosing all of the other elements (except the <legend> tag) so I was attempting to use jQuery's wrapall() to do this.
So if I have the following:
then after the wrapAll() is applied I want it to look like the following:
My latest attempt was the following:
However this is not working and I am getting strange results.
It behaves as if it has wrapped all of the elements of all of the fieldsets into one big <div> as opposed to wrapping the elements of each individual fieldset with <div> tags
I have not been able to get the results that I am after.
Eric, is there a difference in mine and your 3rd option?
Joined: Jul 06, 2009
Thanks for all of the help!
I think that I have it working well now. More testing will tell, but it looks good.
I guess that I just need to get this syntax down. It looks like there are so many different ways to accomplish the same thing, I guess this is part of my confusion.
I should probably work through a jQuery tutorial instead of trying to pick this stuff up on the fly...
Joined: Nov 08, 2001
Gregg, I never saw your code. I thought I would run the test and see what happens if you run the selector with 100 of the fieldsets on the page.
A good rule of thumb with JQuery is get as specific as you can with the initial selectors and keep the logic inside the each as minimal as you can.