Solved

[object][object]

Posted on 2015-02-06
3
54 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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks Rainer! That worked.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

PROBLEM: The other day I was working on adding an ajax request to a webpage that already had a dialog box on the page.  The dialog box was using relative positioning to be positioned next to a form field I had on the page.  Everything was working…
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…
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…

772 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