LUCI: how to hide section based on selection in a drop-down?

So there's the depends method for AbstractValue (https://openwrt.github.io/luci/jsapi/LuCI.form.AbstractValue.html#depends) but I want to achieve the same effect for the section, not the value.

In other words, I have a s1 section and within it a drop-down (config.dns) and I want to hide s2 and s3 sections depending on the value selected (but not saved yet) in the drop-down.

What's the best approach to this? Should I use the onchange for the drop-down? How can I hide/show two more sections from the onchange call?