Skip to content
Advertisement

Move Selected Item to Top of Listbox using javascript using Javascript

I have bind listbox using apex. Below is my code

JavaScript

When I click on Top Button that time Selected Item move on top. For Example, In below Image when I clicked on top button that time ‘Location’ text become first then ‘Demo Site’ and other values are shown in listbox.

Reorder

Here, I also put my JavaScript code for reference :

JavaScript

How can we achieve this?

Advertisement

Answer

Try this, hope it helps you

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement