There is no such thing as
menu
property for the object you are trying to use. This is not how programming work.
Check with this code sample, which really works:
https://jqueryui.com/menu[
^]. Make sure you include the jQuery-UI script, not just jQuery.
—SA