我无法删除此错误:mypage.php:53UncaughtTypeError:Cannotreadproperty'lastChild'ofnull这是由此代码生成的:vartextNode=document.getElementById('element');if(textNode.lastChild.lastChild.nodeName==='BUTTON'){错误是正常的,因为尚未生成。vartextNode仍然不包含代码。该节点仍然不存在:我该怎么说:如果节点不存在...?我想通过说“如果有textnode.lastchild.lastchild”来抑制警告,但是在此错误中进行了任何