jq使用: $("#test1").parent(); // 父节点 $("#test1").parents(); // 全部父节点 $("#test1").parents(".mui-content");//返回class为mui-content的父节点 $("#test1").children(); // 全部子节点 $("#test1").children("#test1"); //返回id为test1的子节点 $("#test1").contents(); // 返回id为test里面的所有内容,包括节点和文本 $("#test1").contents("#test1"); //返回id
增加体验效果请勿用IE、 本站对IE不友好、 o(∩_∩)o 哈哈