开发者

DOM walk javascript

开发者 https://www.devze.com 2023-02-27 08:45 出处:网络
how to get the value out of the picturesPortals from here -Screen - Customers + 0 + 1 - 2 +testings - Portals

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消