Uncaught TypeError: Failed to execute 'removeChild' on 'Node': parameter 1 is not of type 'Node'.
js中出现如上错误,检查验证document.getElementById()中的参数是否传递正确,
例:
var textnumber = parseInt(document.getElementById('tn').value);
var n = "txt"+textnumber;
var x1 = document.getElementById(n);/*n出错*/
textnumber传的参数是否正确,当textnumber不存在或传值错误时,就可能出现上面的错误。
Uncaught DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.
var n_1="qtype"+textnumber2;
var input11 = document.getElementById(n_1);
btn11.removeChild(qtype);/*.removeChild的参数应该是input11的值*/