[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 163
  • Last Modified:

Change list to divs

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
tonelm54
Asked:
tonelm54
1 Solution
 
soupBoyCommented:
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
 
tonelm54Author Commented:
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now