# Have object display expanded on page load

**URL:** <https://talk.observablehq.com/t/have-object-display-expanded-on-page-load/1353>\
**Category:** Help\
**Created:** [October 24, 2018, 10:14am UTC](https://talk.observablehq.com/t/have-object-display-expanded-on-page-load/1353 "2018-10-24T10:14:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![PotOfCoffee2Go](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/potofcoffee2go/32/1091_2.png) [@PotOfCoffee2Go](https://talk.observablehq.com/u/PotOfCoffee2Go)\
**Post date:** [October 24, 2018, 10:14am UTC](https://talk.observablehq.com/t/have-object-display-expanded-on-page-load/1353/1 "2018-10-24T10:14:41Z")

</div>

When a cell represents a JavaScript object is there a way to have it display expanded one level by default?

I’m walking up the DOM from another cell and trigger a click on it - which is contrived at best. If someone has a better way of doing it would be much appreciated!

---

<div class="post-metadata">

**Author:** ![mbostock](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/mbostock/32/9_2.png) [@mbostock](https://talk.observablehq.com/u/mbostock)\
**Post date:** [October 25, 2018, 12:15am UTC](https://talk.observablehq.com/t/have-object-display-expanded-on-page-load/1353/2 "2018-10-25T00:15:42Z")

</div>

We don’t currently have a good way to do this, sorry.

---

<div class="post-metadata">

**Author:** ![PotOfCoffee2Go](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/potofcoffee2go/32/1091_2.png) [@PotOfCoffee2Go](https://talk.observablehq.com/u/PotOfCoffee2Go)\
**Post date:** [October 25, 2018, 2:55am UTC](https://talk.observablehq.com/t/have-object-display-expanded-on-page-load/1353/3 "2018-10-25T02:55:14Z")

</div>

I didn’t think so - couldn’t find it.  
In my case the object being displayed is in a while/await/yield loop, so I update the `<span class>`  
`observablehq--collapsed` entry to `observablehq--expanded`, then resolve the promise that it is waiting on.

> **[Using embedded promise for dynamic display](https://beta.observablehq.com/@potofcoffee2go/using-embedded-promise-for-dynamic-display)**
>
> An Observable notebook by PotOfCoffee2Go.
