Solved

[object][object]

Posted on 2015-02-06
3
57 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

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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)

830 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