【发布时间】:2015-12-16 17:03:06
【问题描述】:
此代码在 Google Chrome 中运行良好,但在 Internet Explorer 中无法运行:
document.getElementsByClassName('info')[i].remove();
是否有其他方法可以做同样的事情,或者我可以让.remove() 在 Internet Explorer 中工作?
【问题讨论】:
-
既然你已经标记了 jQuery,为什么不使用它,而不必担心浏览器特定的故障;
$('.info').eq(i).remove();
标签: javascript jquery cross-browser