document.getElementsByName 在IE与firefox表现不一,解决办法

Posted by bower on June 23, 2009
cross browser

click reference 分享给你的朋友->bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark

rencontre 973 document.getElementsByName 在IE与firefox表现不一,在firefox中会返回相同name的元素列表,而在IE中返回相同ID的元素列表。

buy Pregabalin powder

conocer chicas colombianas en ecuador

http://www.youngasianescorts.co.uk/?baletos=%D8%A5%D8%B4%D8%A7%D8%B1%D8%A7%D8%AA-%D8%AA%D8%AF%D8%A7%D9%88%D9%84-%D8%A7%D9%84%D8%AE%D9%8A%D8%A7%D8%B1%D8%A7%D8%AA-%D8%A7%D9%84%D8%AB%D9%86%D8%A7%D8%A6%D9%8A%D8%A9&204=84 إشارات تداول الخيارات الثنائية <li name=”test” >333</li>
<li name=”test” >333</li>

site rencontre gratuit facebook <li name=”test” >333</li>

rencontres gourmandes 2013 <li name=”test” >333</li>

click site <li name=”test” >333</li>

http://josiart.at/rete/9510 alert(document.getElementsByName(‘test’).length);  firefox返回5,IE返回0

<li id=”test” >333</li>
<li id=”test” >333</li>

<li id=”test” >333</li>

<li id=”test” >333</li>

<li id=”test” >333</li>

alert(document.getElementsByName(‘test’).length);  firefox返回0,IE返回5

由此可以想到一个办法

<li name=”test” id=”test”>333</li>
<li name=”test” id=”test”>333</li>
<li name=”test” id=”test”>333</li>
<li name=”test” id=”test”>333</li>
<li name=”test” id=”test”>333</li>

alert(document.getElementsByName(‘test’).length);  firefox返回5,IE返回5

look at here now 分享到:人人网开心网腾讯微博新浪微博豆瓣分享腾讯空间百度搜藏腾讯书签

分享给你的朋友->bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark

Leave a Reply

Your email address will not be published. Required fields are marked *

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word