JQuery 找到某个id下的某种子标签元素

$("#元素id").find("子标签 子标签下的标签的")

$("#table-div-show").find("tbody tr").each(function(){

//遍历子元素操作

 });

若是不根据id来,找某个标签下的所有子标签

$("tbody tr").each(function(){ });


			$("#table-div-show").find("tbody tr").each(function(){
				if(undefined !=$(this).attr("id") &&'undefined'!=$(this).attr("id")){
					var divId = "";
					var tdID = $(this).attr("id").replace("TR","TD");
					$("#"+tdID).children("div").each(function(){
						console.log("tdID"+tdID);
						divId = $(this).attr("id").replace("DIV_","");
						var flowConfig=$(this).attr("flowConfig");
						if(null!=divId && ""!=divId ){

							divIds.push(divId);
							hiddenFlowConfig[divId] = flowConfig;
							defCreateJs += "$('#li_"+divId+"').show();";
						}
					});
				}
			});

猜你喜欢

转载自blog.csdn.net/zhaofuqiangmycomm/article/details/132182479