jQuery+RequireJS Sample Page
Look at source or inspect the DOM to see how it works.