var divid = "123456"; var count_id_len = $("#parentdiv").find("#"+divid).length; console.log(count_id_len);
即使存在多个结果,结果始终为1.
var conveniancecount = $("div[class*='conveniancecount']").length;