Solved

Change list to divs

Posted on 2013-01-08
2
158 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

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

DOM Attributes and Properties treatment with jQuery 1.6 by Ivo Stoykov jQuery (http://jquery.com/) 1.6 introduces .prop() (http://api.jquery.com/prop/) and .removeProp() (http://api.jquery.com/removeProp/) methods which allow modifying or removi…
Introduction Got endorsements from your clients?  Great!  There is almost nothing better than word-of-mouth advertising.  But how can you do that on the internet?  Sure you can make a page for endorsement quotations and list them all, but who is …
The viewer will learn how to dynamically set the form action using jQuery.
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)

733 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