Instead of handling onload
of the <body>
element, jQuery suggests a bit different approach: $(document).ready()
. Please see: https://learn.jquery.com/about-jquery/how-jquery-works[^].
In a typical script using jQuery, you call all your script functions from the function passed to $(document).ready()
; it is especially important for the code installing some other event handlers.
If you want to use jQuery UI menu, you can use this: https://jqueryui.com/menu[^].
Also, there are many 3rd-party jQuery menu scripts, most typically, jQuery UI plug-ins: http://bfy.tw/19bX[^].
—SA