Vorbly <Code>
CODING MADE EASY WITH VORBLY
WIX CODE ADD DROPDOWN OPTIONS
Need to add options to your dropdown user input? This tutorial will show you how to add options to your dropdown user input using Wix Code. We will provide you with the webpage elements and sample codes required to implement this feature.
THE DEMO
THE ELEMENTS
The Page
User Input: #dropdown1
THE CODE
Page Code
$w.onReady(function () {
$w("#dropdown1").options = [
{ "label": "Option 1: Red", "value": "Red" },
{ "label": "Option 2: Blue", "value": "Blue" },
{ "label": "Option 3: Yellow", "value": "Yellow" }
];
});
COMMENTS
I'm a paragraph. Click here to add your own text and edit me. It's easy.