Yup, possible since this change was made a while back. Here’s a rough example:
https://observablehq.com/d/920d047cba63b1bb#writing-values-from-javascript
Note that this doesn’t handle finer details like user scrolling or changing hashes. (Btw: the notebook is “untitled” because Observable expects the <h1>
in the first cell.)