Solved

[object][object]

Posted on 2015-02-06
3
56 Views
Last Modified: 2015-02-09
Please see fiddle below.

How come the cloned elements are showing as [object][object]?

http://jsfiddle.net/isogunro/vj5489ye/1/
0
Comment
Question by:Isaac
3 Comments
 
LVL 2

Expert Comment

by:E-Risk
ID: 40594773
Are you trying to clone the dropdown or list the items in the dropdown?
I think the issue is putting a dropdown in an unordered list.

Check the fiddle I modified.
http://jsfiddle.net/cr0874/vj5489ye/9/
0
 
LVL 44

Accepted Solution

by:
Rainer Jeschor earned 500 total points
ID: 40594879
Hi,
because the clone function returns the cloned jQuery object. Simply append a ".html()" to the object like
$("#tabs").prepend("<ul id='tabIndex'><li>" + copyFilterBy.html() + "</li></ul>");

Open in new window

and you get the html code of your cloned jQuery object.
(or if you use .text the text content stripped of any HTML tags)

HTH
Rainer
0
 
LVL 5

Author Closing Comment

by:Isaac
ID: 40598262
Thanks Rainer! That worked.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

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 …
Introduction Chart.js, used properly, can visually add a difference to your charting applications. It engages your visitors and allows them to interact with data they otherwise wouldn't be able to without expensive and complicated systems. For this…
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…

770 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