I’m new here and I’d like to ask a question about jQuery.
i have some problem with jquery each, and i have code :
$("#search-submit").click(function(){
var item = $("<span>asdf</span>");
$("body").append(item, item);
}
I just can’t figure out, why is this simple code don’t work. Instead of print “asdf” twice, i just got one “asdf” printed each time i click the button..
this also don’t work. this is so silly…
$("body").append(item);
$("body").append(item);
Thanks a lot… and sorry about my bad english
Denny.
You can append a jQuery object only one time, you can
clonethe object:Or append a string:
http://jsfiddle.net/yKyAL/