Bruno already gave you the right solution.
This is all you need to achieve your aim.
import wixLocation from 'wix-location';
$w.onReady(function () {
$w("#txtReadMore").onClick((event, $item) => {
$item = $w.at(event.context)
$item("#txtReadMore").text = "Clicked!"
wixLocation.to("http://google.com"); // Put in here a url to dynamic-page.
})
});