Custom button on wix editor

I made i custom button with a container, is there a way i can connect it to a href or link to a page?

2

what i got:

import wixLocation from 'wix-location';

import wixLocation from 'wix-location';

$w.onReady(function () {
        
    $w("#custombutton").onClick((event)=>{
        wixLocation.to("https://92fjdv.wixstudio.io/roupa/category/t-shirts");
    })

What i want:

import wixLocation from 'wix-location';

$w.onReady(function () {
        
    $w("#custombutton").onClick((event)=>{
        wixLocation.to("/pageX");
    })

Are you getting an error message? What you specified should work though the onClick should generally be outside the onReady it will work either way.

Also do note that this can be done just in the editor without Velo: Wix Editor: Adding a Link to a Button | Help Center | Wix.com