[ACCEPTED]-.clone() method in jquery without copying value-html

Accepted answer
Score: 28

You can try the code below. By the way, if 3 you use the last version of jQuery I'd suggest 2 using on method instead of live (here instead 1 of body you can use any parent of a element).

$("body").on("click", "a", function() {
    $("ul:last").clone().appendTo(".str").find("input[type='text']").val("");
});​

DEMO: http://jsfiddle.net/vhq5p/18/

Score: 11

Do you mean:

var cln= $("ul:last").clone().find("input").val("").end();

Demo: jsFiddle

0

More Related questions