Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

[object][object]

Posted on 2015-02-06
3
Medium Priority
?
65 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
[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
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 2000 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
This article discusses how to implement server side field validation and display customized error messages to the client.
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)
Suggested Courses

664 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