How to change text on page from the backend

In the page, you’d do

$w('#someId').text = 'some text';

How would I do that from the backend? Like modify text on a specific page.