Vorbly <Code>
CODING MADE EASY WITH VORBLY
WIX CODE RANDOM NUMBER GENERATOR
Need a random number generator? This tutorial will show you how to create a random number generate (between 1 to 999) using Wix Code. You can now create a random serial number for your orders. We will provide you with the webpage elements and sample codes required to implement this feature.
THE DEMO
THE ELEMENTS
The Page
Text Element: #RandomNumber
Button Element: #Generate
THE CODE
Page Code
export function Generate_click(event, $w) {
$w("#RandomNumber").text = (Math.floor((Math.random() * 999) + 1)).toString();
}
COMMENTS
I'm a paragraph. Click here to add your own text and edit me. It's easy.