SVGSVGElement.children无法在IE11中工作? [英] SVGSVGElement.children not working in IE11?

查看:51
本文介绍了SVGSVGElement.children无法在IE11中工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里有一个非常简单的jsfiddle:

I have a very simple jsfiddle here:

http://jsfiddle.net/9uS3u/

它由以下html组成:

It consists of this html:

<svg></svg>

还有这个javascript:

And this javascript:

alert(document.getElementsByTagName("svg")[0].children);

我希望它能提醒类似"[Object HtmlCollection]"的信息.但是,在IE 11中,它给出了未定义".尽管Internet上声称IE 11确实支持svg,但似乎仍未在 SVGSVGElement 上定义 children 属性.是什么赋予了?

I expect it to alert something like "[Object HtmlCollection]". In IE 11 though, it gives "undefined". It seems that the children property is not defined on SVGSVGElement despite claims on the internet that IE 11 does support svg. What gives?

推荐答案

我认为答案是 children 属性尚未正式成为DOM规范的一部分,您可以在其中找到.

I think the answer is that the children property is not yet officially part of the DOM specifications, where you'll find childNodes on the Node interface, but not children (neither on the Element interface). For further info (especially the difference between children and childNodes), have a look at this other answer.

这篇关于SVGSVGElement.children无法在IE11中工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆