Help with nui needed

I was making a simple music playing gui, just to dip my toes into fivem mod development.
Here it is:
mobileRadio.rar (2.4 KB)

If i run the js as a client script, exports work, but it won’t be able to manipulate the ui.
If i reference the js in the html, exports don’t work.

Is there a way to make exports work like this?
Is there a way to manipulate the ui externally?

Haven’t looked at the code, nor cared enough to read the whole post, but don’t you want to use SendNuiMessage?

https://docs.fivem.net/docs/scripting-reference/runtimes/lua/functions/SendNUIMessage/
I don’t think this would solve it.

What’s your issue specifically? Please resume.

I solved it.
I’ll post later i’m tired.