Here's a code like this: http://jsfiddle.net/TryrR/
In normal browsers - ok, writes 1, in IE - writes 0.
How to solve this problem on pure JS?
Here's a code like this: http://jsfiddle.net/TryrR/
In normal browsers - ok, writes 1, in IE - writes 0.
How to solve this problem on pure JS?
Try this fix:
Before the advent of the HTML5 standard, this method returned only those elements that provided support for the name attribute, in particular: iframe, a, input, and others.
In modern browsers, the tag doesn't matter, but the old behavior can be seen by trying the example below in IE10 and up to version 10.
In IE9, the method will not find elements for which there is no name attribute in the standard.
From here: http://learn.javascript.ru/searching-elements-dom#getelementsbyname
Source: https://ru.stackoverflow.com/questions/206760/
All Articles