📜  作为 onclick 删除此 html 标记 - Html 代码示例

📅  最后修改于: 2022-03-11 14:52:55.197000             🧑  作者: Mango

代码示例1
function remove() {
  var element = this.id;
  //I have also tried using document.getElementByID(this.id)
  element.remove();
  //I have also tried using element.parentNode.removeChild(element); to remove the element.
}