How can I use JavaScript in Phoenix LiveView?

I want everything to execute in browser, don’t want to send back and forth code to the backend. the cookies are stored in the browser it should be done everything on the client locally. Check this code of mine: Cookies in Phoenix LiveView not taken into account only after the second F5 refresh - #3 by dojap