求教大神一个关于jQuery自动生成标签的有关问题,求指导

求教大神一个关于jQuery自动生成标签的问题,求指导
<script>
function thrFunction()
{
$("#thrList").append("<li class='choose'><div class='drop droppable'>新增表项</div></li>");
dropp();
}
</script>
这是我点击按钮自动生成li的function,现在我想要给每个自动生成的li标签一个随机ID,应该怎样实现啊
------解决方案--------------------

function _getRandomString(len) {//随机生成指定长度字符串
var chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678'; 
var maxPos = chars.length;
var str = '';
for (i = 0; i < len; i++) {
str += chars.charAt(Math.floor(Math.random() * maxPos));
}
return str;
}

function thrFunction()
{
var str = _getRandomString(6);
$("#thrList").append("<li id='"+str+"' class='choose'><div class='drop droppable'>新增表项</div></li>");
dropp();
}

------解决方案--------------------
我喜欢这样写,当然拼接字符串也是可以的
  $("#thrList").append(
    $("<li>").attr({'class':'choose','id':Math.ceil(Math.random()*10)})
    .append("<div class='drop droppable'>新增表项</div>")
  );

------解决方案--------------------

function thrFunction(){
    var l = $("<li id='" + $.expando + "' class='choose'><div class='drop droppable'>新增表项</div></li>").appendTo('#thrList');
}
thrFunction();