Open In App

jQuery UI | Menu

Menu widget in jQuery UI creates a menu that contains items and sub-items in a sub-menu related to a particular item on the menu. Menu items are created using mark-up elements using a parent-child like relation which can be created using lists and nested lists. Each menu item generally corresponds to a specific page and hence each of these elements is between an anchored tag.

Syntax:



$(selector, context).menu(options)

You can provide one or more options at a time using a JavaScript object.

If there is more than one choice to be provided then you may separate them using a comma as follows



$(selector, context).menu ("action", params)

For navigation, we can create a menu by using jQuery UI. We can create a main menu and sub-menu by using the menu. We will create one list and sub-list in HTML and that will be used to create the menu using jQuery UI.


Article Tags :