Home > Back-end >  What wrong with .onclick() event?
What wrong with .onclick() event?

Time:09-21

im newbie on javascript

I try add .onclick() action on wix console interface but i think i made some error on my code :

enter image description here

import {local} from 'wix-storage';
import wixWindow from 'wix-window';

 $w.onReady(function () {
   if('#button2').onClick {
     wixWindow.openLightbox("Conditions générales de vente");
 }
} );

I try to understanding the particularly .onClick() on their API but i do not see...

https://www.wix.com/velo/reference/$w/selectiontags/onclick

Thanks

CodePudding user response:

onClick() is a function. The event handler is the argument to the function.

$w.onReady(() => {
  $w('#button2').onClick(() => {
    wixWindow.openLightbox("Conditions générales de vente");
  });
});
  • Related