我使用jQuery进行排序李标签列表,我当前的代码是:检索对象自己的标签
var arr = [];
$("ul li").each(function() {
arr.push($(this));
});
arr.sort(cmpFunction);
$("ul").find("li").remove();
$.each(arr, function(index, item){
console.log(item.html());
});
什么我发现用的console.log虽然 - 是我失去含外李标签(与HTML5数据属性,我想保持)
是否有另一种选择为.html(),这将使我的对象L1标签以及
我已经提供了一个简单的例子就是我需要在这里:http://jsbin.com/esalas/5
是不是这只是这个问题的重复:http://stackoverflow.com/questions/2419749/get-selected-elements-outer-html? – 2012-03-28 10:34:22