If you have the following on a page: <img src="http://image1" name="myimage" /> <img src="http://image2" name="myimage" /> Then in javascript reference document.images['myimage']. In IE, Firefox and Opera this returns back a reference to one of the images. However Safari is returning back a Collection object. According to DOM Level 1 (HTML) http://www.w3.org/TR/REC-DOM-Level-1/level-one-html.html: The Node with a name or id attribute whose value corresponds to the specified string. Upon failure (e.g., no node with this name exists), returns null.
I am unable to reproduce this bug and I am not clear on web-spec and I get following behavior based on this test case (changed to JSFiddle from Comment 0): Link - https://jsfiddle.net/atxj48fo/show ** Safari 15.6 on macOS 12.5 - <img src="http://image1" name="myimage"> ** Firefox Nightly 104 - <img src="http://image1" name="myimage"> ** Chrome Canary 106 - <img src="http://image1" name="myimage"> All of them are matching but not sure on web-spec so I am going to just share this much update. Thanks!