How to initiate ojet menu from javascript

We are using below function in java script to trigger oj-dialog and its working fine.

else if(operation === "fmethod"){
            
            var popup = document.getElementById("fPopUp");
            if (!popup.isOpen()) {
                popup.open();
            }
            return;

But when I am using the same function to trigger oj-menu or any other oj element we are getting “popup.isOpen is not a funtion” error.

Can someone let me know what should be the equivalent syntax of javascript to trigger or start oj-menu.