[Project_owners] getElementsByTagName() problem

HJ bugs4hj at yahoo.com
Wed Apr 12 11:37:54 EDT 2006


Neil wrote:
> Philip Chee wrote:
> 
>> On Wed, 12 Apr 2006 09:33:50 +0100, Neil wrote:
>>
>>> In addition to what everyone else said, in JavaScript 1.6 (Gecko 1.8) 
>>> you can use
>>> var inputFields = Array.slice(doc.getElementsByTagName("input"));
>>>   
>> According to MDC Array.slice is available in Javascript 1.2 ?!?
>> <http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Array:slice> 
>>
>>
> Yes, but in 1.6 it works on any object with length and item properties, 
> not just arrays.

Note: because getElementsByTagName() returns a node list.

/HJ


More information about the Project_owners mailing list