In order to adjust the style of a dropdown menu, I need to change its top value to align it properly. The element is being generated by Drupal (a CMS tool) and is configured with classes for styling purposes in the admin view where content is authored. However, when trying to target the attached classes to modify the styling, I am encountering difficulties as the elements are returned as an HTML collection rather than an array, making it challenging to apply style changes.
<ul class="selectBox-dropdown-menu selectBox-options form-control-selectBox-dropdown-menu form-select-selectBox-dropdown-menu news-feed-dropdown" style="width: 78.1125px;top: 210px;"><li class="selectBox-selected"><a rel="All">Show All</a></li><li class=""><a rel="announcement_post">Announcements</a></li><li class=""><a rel="blog">Blogs</a></li><li class=""><a rel="promotions">Promotions/New Hires</a></li><li class=""><a rel="shoutouts">Shoutouts</a></li></ul>
Here is the Javascript code that I have attempted so far:
var options = document.getElementsByClassName("selectBox-dropdown-menu");
console.log("triggered");
options[0].style.top = "174px";
The unordered list initially remains hidden and is set to display as block upon clicking. Any assistance in resolving this issue using plain JS or jQuery would be greatly appreciated. Thank you in advance.