{"id":6583,"date":"2018-06-28T10:00:15","date_gmt":"2018-06-28T01:00:15","guid":{"rendered":"https:\/\/www.gigas-jp.com\/appnews\/?p=6583"},"modified":"2018-06-28T10:55:43","modified_gmt":"2018-06-28T01:55:43","slug":"htmlcollection%e3%81%8citerable%e3%81%8b%e3%81%a9%e3%81%86%e3%81%8b%e3%81%ae%e6%a4%9c%e8%a8%bc","status":"publish","type":"post","link":"https:\/\/www.gigas-jp.com\/appnews\/archives\/6583","title":{"rendered":"HTMLCollection\u304citerable\u304b\u3069\u3046\u304b\u306e\u691c\u8a3c"},"content":{"rendered":"<p>\u7a81\u7136\u3067\u3059\u304c\u3001Chrome\u3001Safari\u3001Firefox\u3001Microsoft Edge\u306e\u4e2d\u3067<br \/>\n \u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u304c\u52d5\u304b\u306a\u3044\u3082\u306e\u304c\u4e00\u3064\u3060\u3051\u3042\u308a\u307e\u3059\u3002<\/p>\n<table style=\"height: 77px;width: 555px\">\n<tbody>\n<tr style=\"height: 10.875px\">\n<td style=\"width: 547px;height: 10.875px\">\n<p>&lt;script&gt;<br \/>\n <strong>for<\/strong> (let element <strong>of<\/strong> document.<strong>getElementsByTagName<\/strong>(&#8216;div&#8217;)) {<br \/>\n \u00a0 \u00a0 \u00a0console.log(element)<br \/>\n }<br \/>\n &lt;\/script&gt;<strong><br \/>\n <\/strong><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><!--more--><\/p>\n<h3>\u3084\u306f\u308a\u3002\u3002\u3002<\/h3>\n<p>\u3053\u306eWEB\u696d\u754c\u306b\u9577\u5e74\u95a2\u308f\u3063\u3066\u304d\u305f\u7686\u69d8\u306a\u3089\u3070\u3001\u3059\u3050\u306b\u304a\u5bdf\u3057\u304c\u4ed8\u304f\u3060\u308d\u3046\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n \u4e0a\u8a18\u306e\u30b3\u30fc\u30c9\u304c\u52d5\u304b\u306a\u3044\u306e\u306f\u3001<strong>Microsoft Edge<\/strong>\u306e\u307f\u3067\u3059\u3002<\/p>\n<div id=\"attachment_6584\" style=\"width: 580px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-6584\" loading=\"lazy\" class=\"wp-image-6584 size-full\" src=\"\/appnews\/wp-content\/uploads\/sites\/4\/2018\/06\/edge_error.png\" alt=\"\" width=\"570\" height=\"508\" \/><p id=\"caption-attachment-6584\" class=\"wp-caption-text\">Microsoft Edge<\/p><\/div>\n<p>Chrome\u3084Safari\u3001Firefox\u306f\u7121\u4e8b\u306b\u52d5\u4f5c\u3057\u307e\u3059\u3002<\/p>\n<p>\u305f\u3060Edge\u306f\u65e2\u306bECMAScript 2016(JavaScript\u306e\u4ed5\u69d8) \u306b\u306f\u5b8c\u5168\u5bfe\u5fdc\u3057\u3066\u3044\u308b\u305f\u3081\u3001<br \/>\n <strong>for-of \u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8<\/strong>\u306f\u554f\u984c\u306a\u304f\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002<br \/>\n \u3057\u304b\u3057\u30a8\u30e9\u30fc\u6587 <span style=\"color: #ff0000\"><strong>Object doesn&#8217;t support property or method &#8216;Symbol.iterator&#8217; <\/strong><span style=\"color: #000000\">\u3092\u8aad\u307f\u307e\u3059\u3068<br \/>\n <\/span><\/span><em><strong>document.getElementsByTagName()<\/strong><\/em>\u30e1\u30bd\u30c3\u30c9\u3067\u8fd4\u3055\u308c\u308bHTMLCollection\u304c<strong>\u30a4\u30c6\u30ec\u30fc\u30d6\u30eb<\/strong>\u3067\u306a\u3044\u3053\u3068\u304c\u539f\u56e0\u306e\u3088\u3046\u3067\u3059\u3002<br \/>\n (for-of\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3067\u8981\u7d20\u3092\u53d6\u308a\u51fa\u305b\u308b\u306e\u306f\u3001\u30a4\u30c6\u30ec\u30fc\u30d6\u30eb\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\uff09<\/p>\n<h3>\u3060\u304c\u3057\u304b\u3057\u3001Microsoft\u306f\u9593\u9055\u3063\u3066\u3044\u306a\u304b\u3063\u305f\u3002\u3002\u3002<\/h3>\n<p>document.getElementsByTagName()\u30e1\u30bd\u30c3\u30c9\u304cHTMLCollection\u3092\u8fd4\u3059\u4ed5\u69d8\u306f\u30012015\u5e74\u306b\u5b8c\u5168\u767a\u884c\u3055\u308c\u305f<a href=\"https:\/\/www.w3.org\/TR\/2015\/REC-dom-20151119\/#concept-tree-child\" target=\"_blank\" rel=\"noopener noreferrer\">DOM Level4<\/a>\u3067\u5b9a\u3081\u3089\u308c\u305f\u4ed5\u69d8\u3067\u3059\u3002<br \/>\n \u3064\u307e\u308aEdge\u306f\u3001\u6700\u65b0\u306eDOM\u4ed5\u69d8\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u305d\u3053\u3067\u4e0a\u8a18\u306eW3C\u306e<a href=\"https:\/\/www.w3.org\/TR\/2015\/REC-dom-20151119\/#htmlcollection\" target=\"_blank\" rel=\"noopener noreferrer\">HTMLCollection<\/a>\u306e\u4ed5\u69d8\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n<table style=\"height: 77px;width: 467px\">\n<tbody>\n<tr style=\"height: 10.875px\">\n<td style=\"width: 459px;height: 10.875px\">\n<pre class=\"idl\">interface <dfn id=\"htmlcollection\">HTMLCollection<\/dfn> {\r\n  readonly attribute unsigned long length;\r\n  getter Element? item(unsigned long <var>index<\/var>);\r\n  getter Element? namedItem(DOMString <var>name<\/var>);\r\n};<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u306a\u3093\u3068\u3001\u3082\u3068\u3082\u3068HTMLCollection\u306f\u30a4\u30c6\u30ec\u30fc\u30d6\u30eb\u3068\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u306a\u3044\u3088\u3046\u3067\u3059\u3002<\/p>\n<p>\u5ff5\u306e\u305f\u3081\u306bW3C\u3067\u30a4\u30c6\u30ec\u30fc\u30d6\u30eb\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3067\u3042\u308b\u3068\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308b<a href=\"https:\/\/www.w3.org\/TR\/2015\/REC-dom-20151119\/#nodelist\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>NodeList<\/strong><\/a>\u306b\u5bfe\u3057\u3066\u3001<strong>for-of\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8<\/strong>\u304c\u4f7f\u7528\u3067\u304d\u308b\u304b\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<br \/>\n (childNodes\u30d7\u30ed\u30d1\u30c6\u30a3\u304cNodeList\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u8fd4\u3057\u307e\u3059\uff09<\/p>\n<table style=\"height: 77px;width: 555px\">\n<tbody>\n<tr style=\"height: 10.875px\">\n<td style=\"width: 547px;height: 10.875px\">\n<p>&lt;script&gt;<br \/>\n <strong>for (<\/strong>let node <strong>of<\/strong> document.body.<strong><span style=\"color: #ff0000\">childNodes<\/span>)<\/strong> {<br \/>\n \u3000\u3000\u3000\u3000console.log(&#8220;node.type = &#8221; + node.nodeType)<br \/>\n \u3000\u3000\u3000\u3000console.log(node)<br \/>\n }<br \/>\n &lt;\/script&gt;<strong><br \/>\n <\/strong><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u4e0a\u8a18\u306e\u30b3\u30fc\u30c9\u306f\u3001Microsoft Edge\u3067\u3082\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u554f\u984c\u306a\u304f\u52d5\u4f5c\u3059\u308b\u3053\u3068\u304c\u78ba\u8a8d\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n<p><img loading=\"lazy\" class=\"alignnone wp-image-6585 \" src=\"\/appnews\/wp-content\/uploads\/sites\/4\/2018\/06\/edge_childnodes.png\" alt=\"\" width=\"662\" height=\"530\" \/><\/p>\n<p>\u3069\u3046\u3084\u3089HTMLCollection\u304c\u30a4\u30c6\u30ec\u30fc\u30d6\u30eb\u3067\u306a\u3044\u7406\u7531\u306f\u3001Microsoft\u304c\u53b3\u5bc6\u306bW3C\u306e\u4ed5\u69d8\u3092\u5b88\u3063\u3066\u3044\u308b\u3053\u3068\u304c\u539f\u56e0\u306e\u3088\u3046\u3067\u3059\u3002<\/p>\n<p>Microsoft\u306fIE8\u4ee5\u964d\u3001W3C\u304c\u5b9a\u3081\u308b\u4ed5\u69d8\u306b\u7a4d\u6975\u7684\u306b\u6e96\u62e0\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n (<a href=\"https:\/\/www.mitsue.co.jp\/knowledge\/column\/20080321.html\" target=\"_blank\" rel=\"noopener noreferrer\">\u4e3b\u8981\u30d6\u30e9\u30a6\u30b6\u306e\u958b\u767a\u52d5\u5411\u3068Web\u6a19\u6e96\u6e96\u62e0<\/a>)<\/p>\n<p>\u305f\u3060\u4ed5\u69d8\u3068\u3044\u3046\u306e\u306f\u6700\u4f4e\u9650\u3067\u3042\u308a\u3001\u7d20\u6575\u306a\u6a5f\u80fd\u304c\u305d\u306e\u6a2a\u306b\u3042\u3063\u305f\u3068\u3057\u3066\u3082\u8ab0\u3082\u554f\u984c\u306b\u3057\u306a\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<p>\u6728\u66dc\u65e5\u62c5\u5f53<br \/>\n yoshimoto<\/p>\n<h3>\u53c2\u8003<\/h3>\n<p><a href=\"https:\/\/www.fxsitecompat.com\/ja\/docs\/2012\/element-getelementsby-now-returns-htmlcollection\/\" target=\"_blank\" rel=\"noopener noreferrer\">Element.getElementsBy* \u304c HTMLCollection \u3092\u8fd4\u3059\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f<\/a><\/p>\n<p><a href=\"https:\/\/www.w3.org\/TR\/2015\/REC-dom-20151119\/\" target=\"_blank\" rel=\"noopener noreferrer\">W3C DOM4<\/a><\/p>\n<p><a href=\"https:\/\/www.w3schools.com\/jsref\/dom_obj_htmlcollection.asp\" target=\"_blank\" rel=\"noopener noreferrer\">DOM HTMLCollection<\/a><\/p>\n<div class='wp_social_bookmarking_light'>\n            <div class=\"wsbl_google_plus_one\"><g:plusone size=\"medium\" annotation=\"none\" href=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/6583\" ><\/g:plusone><\/div>\n            <div class=\"wsbl_hatena_button\"><a href=\"\/\/b.hatena.ne.jp\/entry\/https:\/\/www.gigas-jp.com\/appnews\/archives\/6583\" class=\"hatena-bookmark-button\" data-hatena-bookmark-title=\"HTMLCollection\u304citerable\u304b\u3069\u3046\u304b\u306e\u691c\u8a3c\" data-hatena-bookmark-layout=\"standard\" title=\"\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u3092\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306b\u8ffd\u52a0\"> <img src=\"\/\/b.hatena.ne.jp\/images\/entry-button\/button-only@2x.png\" alt=\"\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u3092\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306b\u8ffd\u52a0\" width=\"20\" height=\"20\" style=\"border: none;\" \/><\/a><script type=\"text\/javascript\" src=\"\/\/b.hatena.ne.jp\/js\/bookmark_button.js\" charset=\"utf-8\" async=\"async\"><\/script><\/div>\n            <div class=\"wsbl_twitter\"><a href=\"https:\/\/twitter.com\/share\" class=\"twitter-share-button\" data-url=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/6583\" data-text=\"HTMLCollection\u304citerable\u304b\u3069\u3046\u304b\u306e\u691c\u8a3c\" data-via=\"GIGASJAPAN_APPS\" data-lang=\"ja\">Tweet<\/a><\/div>\n            <div class=\"wsbl_facebook_like\"><div id=\"fb-root\"><\/div><fb:like href=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/6583\" layout=\"button_count\" action=\"like\" width=\"100\" share=\"false\" show_faces=\"false\" ><\/fb:like><\/div>\n            <div class=\"wsbl_facebook_send\"><div id=\"fb-root\"><\/div><fb:send href=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/6583\" colorscheme=\"light\" ><\/fb:send><\/div>\n    <\/div>\n<br class='wp_social_bookmarking_light_clear' \/>\n","protected":false},"excerpt":{"rendered":"<p>\u7a81\u7136\u3067\u3059\u304c\u3001Chrome\u3001Safari\u3001Firefox\u3001Microsoft Edge\u306e\u4e2d\u3067 \u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u304c\u52d5\u304b\u306a\u3044\u3082\u306e\u304c\u4e00\u3064\u3060\u3051\u3042\u308a\u307e\u3059\u3002 &lt;script&gt; for (let element of docum [&hellip;]<\/p>\n","protected":false},"author":15,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[100],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts\/6583"}],"collection":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/comments?post=6583"}],"version-history":[{"count":19,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts\/6583\/revisions"}],"predecessor-version":[{"id":6605,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts\/6583\/revisions\/6605"}],"wp:attachment":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/media?parent=6583"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/categories?post=6583"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/tags?post=6583"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}