If you need to change index.html, you need to copy index-example.html from the deployment/web folder to the theme/web folder, and rename it index.html.
https://docs.mendix.com/howto/front-end/customize-styling-new#9-customizing-index-html-web
To add JavaScript to individual pages, you’ll want to look at the HTML Snippet and JavaScript Snippet modules in the Marketplace.
https://marketplace.mendix.com/link/component/56
https://marketplace.mendix.com/link/component/43096
Hope this helps.
You can use this widget for adding custom JS
We can make use of Javascript snippet from Mendix app store to add javascript to the pages. In that, we can also add Jquery.