Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

93
Views
Editing dropdown values without having to create a new dropdown every time

Within the code.org javascript editor for the applab, there is the ability to create a dropdown by creating a dropdown by:

dropdown('id', 'option1', 'option2', ...);

I would like to know if there is a way to edit the list, treating it something like an array:

remove('id', 'position');

and:

insert('id', 'position', 'item1', 'item2'...);

any help would be appreciated, as I can't find any way to do this in other places.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can convert dropdown to an array using getProperty. Then, edit the array, and convert it back to a dropdown with setProperty. Here's the code;

dropdown("id", "a", "b", "c");
function editDropdown() {
  var myDropdown = getProperty("id", "options");
  //add someting to your dropdown.
  appendItem(myDropdown, "e");
  //remove something from your dropdown.
  removeItem(myDropdown, "a");

  setProperty("id", "options", myDropdown);
  
}
editDropdown();
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!