target nav class in wp_nav_menu

If you take a look at the wp_nav_menu()‘s documentation, you notice that you have control over the most of wrappers’ class and ID. Here’s what you can pass to the wp_nav_menu() function:

'menu_class'

(string) CSS class to use for the ul element which
forms the menu. Default ‘menu’.

'menu_id'

(string) The ID that is applied to the ul element which
forms the menu. Default is the menu slug, incremented.

'container'

(string) Whether to wrap the ul, and what to wrap it
with. Default ‘div’.

'container_class'

(string) Class that is applied to the container.
Default ‘menu-{menu slug}-container’.

'container_id'

(string) The ID that is applied to the container.

So, in your case you can pass the main-nav js--main-nav to the menu_class and false or an empty string to the menu_id. Although I have to mention, having an ID for the ul will not hurt. Removing it won’t do anything unless there is a conflict because of this.