Ok, at first → FORGET ABOUT THE USAGE OF EXPORT FUNCTIONS!
Instead use the following coding-style…
$w.onReady(()=>{$w('#image1').onClick(event){// ----> YOUR CODE HERE.....});});
$w.onReady(()=>{
$w('#image1').onClick(event){console.log("Click")
let randomValue = getRandomArbitrary(min,max);
console.log("RETURNED-RANDOM-VALUE: ", randomValue);
$w(`#image${randomValue}`).show();
});
});
function getRandomArbitrary(min,max){
return Math.random()*(11-1)+1;
}
You hand over min and max values, but you do not use them inside of your function!
How and where to check the RESULTS inside of —> CONSOLE ?
If you are using → GOOGLE-CHROME → Press F12 and navigate to → CONSOLE.
If you are working on Wix-Editor → start the PREVIEW-MODE and open the CONSOLE on the very bottom of the Wix-Editor.
Investigate what happens, when you do actions.
EDIT:
Let’s improve our code and eleminate all little syntax-errors…
$w.onReady(()=>{
$w('#image1').onClick((event)=>{
console.log("Click");
let min = 1, max = 10;
let randomValue = getRandomArbitrary(min,max);
console.log("RETURNED-RANDOM-VALUE: ", randomValue);
$w(`#image${randomValue}`).show();
});
});
function getRandomArbitrary(min,max){
return Math.random()*(11-1)+1;
}
Let’s take this pic , to set it as our click-trigger - - > ID = $w(‘#image1’)
As you can see, i just defined min and max in hardcoded mode… for testing…
let min = 1, max = 10;
So here you can see the returned results inside of the console-log.
Here you can emmidiatelly recognize – > that your function will never work like that!
WHY ???
Because you get some
decimal numbers instead of integers (normal numbers)

But what’S exactly the issue?
The issue is → that you don’t have a pic on your page with the ID-Ending of - - > for example - - → RETURNED-RANDOM-VALUE: 9.183038827734011
You need clear fixed and defined NUMBERS like → 1,2,3,4,5,6,7,8,9
if(randomValue===1) {...}
else if(randomValue===2) {...}
else if(randomValue===3) {...}
else if(randomValue===4) {...}
else {...}
...or the direct way....
$w(`#image${randomValue}`).show();
So you have first to round the returned result-number.
The Math.abs() Method
The Math.ceil() Method
The Math.floor() Method
The Math.round() Method
The Math.fround() Method
The Math.trunc() Method
JavaScript Math round() Method.
Now first make some brainstorming and learn the stuff, before you continue…
Choose the right rounding-function for your own needs…