Sure, you can. Be sure to use the Mendix Client API whenever you can when manipulating the DOM:
https://apidocs.mendix.com/8/client/module-mxui_dom.html
If you don't you use the client API but change the DOM with default JavaScript, you could encounter clean up issues of elements created out of the Client API not being cleaned up properly.
Hi,
Not exactly what you asked for, but I like to use the javascript snippet to do something like that
https://appstore.home.mendix.com/link/app/43096/