Use the conditional operator, and check the length of the selection:
target = el.querySelectorAll("[data-update]").length
? el.querySelectorAll("[data-update]")
: el.querySelectorAll("div.ui-content");
Basically a ? b : c
means if a is true, take b, else take c. More infor on: Contional operator.
Besides, if you don't want to repeat the first selection, you can add an extra step:
target = el.querySelectorAll("[data-update]");
target = target.length ? target : el.querySelectorAll("div.ui-content");
The first tme you see this syntax is really strange. But you'll soon get used to it.
NOTE: in JavaScript, zero is treated as false. And a none-zero number is treated as true.