JQuery finds a certain sub-tag element under a certain id

$("#element id").find("subtag tag under subtag")

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

//Traverse sub-element operations

 });

If not based on ID, find all sub-tags under a certain tag

$("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();";
						}
					});
				}
			});

Guess you like

Origin blog.csdn.net/zhaofuqiangmycomm/article/details/132182479