Finished js for the dropdown