Solved

Change list to divs

Posted on 2013-01-08
2
156 Views
Last Modified: 2013-01-11
Ive been trying to figure out a simple way of taking a list and converting it to divs

So if I had an unordered list:-
<ul style="rounded">
 <li>Coffee</li>
 <li>Milk</li>
</ul> 

Open in new window


Which would convert to:-
<div style="rounded">
 <div>Coffee</div>
 <div>Milk</div>
</div> 

Open in new window


I've found some articles that suggest using .map but I cant find anything really that describes how it can work.

My idea is to copy the jQuery UI Tab idea where clicking on a div will open another div.

Does anyone have any suggestions, or examples?
0
Comment
Question by:tonelm54
2 Comments
 
LVL 8

Accepted Solution

by:
soupBoy earned 500 total points
ID: 38757044
There is probably a better way to do this, but check out this little fiddle I just created: Convert an unordered list and it's list items to DIVs

- Chris
0
 

Author Comment

by:tonelm54
ID: 38769043
Wondering if you could look at a new question I've posted, related to this, which is my attempt of doing this, with your code but I cannot figure out where I'm going wrong

Q_27992940

Thank you for your help
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

What is a Lightbox? A Lightbox is the effect you see when you click, for example, an image and the screen fades out and up pops the same image but in its full size dimensions. There are lots of Lightbox effects for jQuery. Problem is they are a…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question