Solved

Change list to divs

Posted on 2013-01-08
2
154 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Introduction JSON is an acronym for JavaScript Object Notation.  It is a text-string data transport mechanism, capable of representing simple or complex data structures in a consistent and easy-to-read manner.  Similar in concept to XML, but more e…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn how to dynamically set the form action using jQuery.
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…

707 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now