javascript - why is jquery cloning the children element also? -


मान लीजिए मेरे पास निम्न कोड है:

  & lt; ul & gt; & Lt; li & gt; 1 & lt; / li & gt; & Lt; li & gt; 2 & lt; / li & gt; & Lt; li & gt; 3 & lt; / li & gt; & Lt; / ul & gt;   

अब जब मैं करता हूँ, $ ("ul")। क्लोन (); , यह पूर्ण ul तत्व क्लोन करता है (सभी इसके बच्चों को भी)। मैं केवल ; l & gt; और उसके बच्चों को क्लोन करना नहीं चाहता।

इसे jQuery में कैसे करें?

मुझे शुद्ध जावास्क्रिप्ट में पता है (< कोड> क्लोन-नोड () ), लेकिन मैं इसे करने के लिए अतिरिक्त तरीकों की वजह से इसका उपयोग नहीं कर सकता।

यदि कई तत्व हैं, तो यह कार्य लूप में करें।

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -