Code problem help

Hello, I’ve recently started creating a Wix site but I’ve run into a problem with some code.

export function button6_click(event) {
$w("#button6").link = "/wiki";
$w("#button6").style.color = "#E8B556";
$w("#button4").style.color = "#E8E6E6";
}

I’m trying to link the button to a page on the website but when I run the site and click the button nothing happens. Does anyone know how to fix this?

Even me too same thing happened!

You do not need to configure an onclick event in the code, configure the button action in the editor with any link, and change the link in the code as needed.

  1. $w.onReady( function () {

  2. $w(“#button1”).link = “https://www.google.co.il”;

  3. } );

Still doesn’t work, It only works if i delete the whole code

@rainmillerbusiness What code did you delete? Is it working now? If it’s working, then I guess everything is OK.

If you still need help, please provide more information. Post your code that isn’t working, explain what you are trying to do, what works, and what doesn’t.

@rainmillerbusiness Basically if you use onclick event in this code it conflicts with the button settings in the editor, if you still want to define in the code you have to create a button yourself by text, box, shape … and set the changes you want to happen when you click