I have been looking for a way to have one file for my dropdown menu in the same way that i can put all my styles and other stuff in a separate js and css file. obviously for easy maintenance and changing, does anyone know of a way i can do this?
Yes, there certainly are ways to do it. Some are much easier and more stable than others. Do you have any server side languages available, such as PHP or SSI? They will work much better than a pure javascript solution. But if you do need to use javascript you can use innerHTML to put your menu where you want it on the page. Also you can just have a menu made up as a file or you can generate from an array. The array is easier to edit and change. But it gets more complicated for higher lever menus.