有时候难免需要使用js进行 dom 操作;如在删除地图feature时同时得清除提示框
js通过className删除元素
这个就需要使用 .parentNode.removeChild(元素)


	let chArr = document.body.getElementsByClassName("tooltip-static");
	for(i=0;i<chArr.length;i++){
	     //删除元素 元素.parentNode.removeChild(元素);
	    if (chArr[i] != null) 
	          chArr[i].parentNode.removeChild(chArr[i]); 
	}

相关文章:

  • 2022-12-23
  • 2021-12-02
  • 2022-12-23
  • 2021-12-26
  • 2022-12-23
  • 2022-12-23
  • 2021-08-26
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-05-18
  • 2021-12-13
  • 2022-01-17
  • 2021-12-04
  • 2022-12-23
相关资源
相似解决方案