my question was how to connect an element with js
This is how you connect your elements from the DOM (Document Object Model) to your JS.
const yourVariable = document.querySelector('h1');
So I did show you how to do that. I put it wasn’t the best way to do it because you were referencing styling in your question. Something like this would be done in CSS. If you really wanted it done in JS I would add a class to it and get the class from the DOM rather than the element in the HTML.
This is how you can add styles from your JS to an element from your HTML.
yourVariable.style.fontFamily = 'arial';
which I also showed you how to do in my original post.