gitting a collection to all DIV elms working in all browsers
|
| View previous topic :: View next topic |
| Author |
Message |
Jackil
Joined: 24 May 2006 Posts: 97
|
| Is there a way of getting a collection to all DIV elements on a website that works in all (most) browsers? |
| |
|
|
|
|
Peter Pitt
Joined: 20 May 2006 Posts: 114 Location: Egypt
|
| Document.getElementsByTagName('div') |
| |
|
|
Jackil
Joined: 24 May 2006 Posts: 97
|
| That works in ff too? |
| |
|
|
Peter Pitt
Joined: 20 May 2006 Posts: 114 Location: Egypt
|
| Tias |
| |
|
|
Jackil
Joined: 24 May 2006 Posts: 97
|
| Does javascript have hash lists? |
| |
|
|
Peter Pitt
Joined: 20 May 2006 Posts: 114 Location: Egypt
|
| No |
| |
|
|
Jackil
Joined: 24 May 2006 Posts: 97
|
| That allows strings as indexes |
| |
|
|
Peter Pitt
Joined: 20 May 2006 Posts: 114 Location: Egypt
|
| But you can create objects which work similarly |
| |
|
|
Jackil
Joined: 24 May 2006 Posts: 97
|
| how do i define an object |
| |
|
|
Peter Pitt
Joined: 20 May 2006 Posts: 114 Location: Egypt
|
| Simplest way is var x = { 'key' : value, 'key2' : value2 }; |
| |
|
|
|
|