DOM walk javascript
how to get the value out of the picturesPortals from here
-Screen
- Customers
+ 0
+ 1
- 2
+testings
- Portals
-pictureportal
+ 0
-开发者_StackOverflow社区 1
- name "portal 1"
Above is how it renders in firefox DOM. I want to alert out the value of name in pictureportal I tried
alert(Screen.Customers[2]['Portals']['pictureportals'][1]['name']);
But that didnt work
It doesn't seem like you're trying to walk the DOM, but access a deep object property.
If that's right, it would be something like this:
Screen.Customers[2].Portals.pictureportal[1].name
Note that I'm using using pictureportal
and not pictureportals
.
精彩评论