How to target a bricks form input to filling with js

I am using js to fill a field on page load with the value of a cookie or local storage. Issue is that the “ID” shown in Bricks Builder for the form field input is not correct, it does not get assigned that ID, but rather its in the input Name. I’d like to add my own classes to the input, so I can target that way (all forms on the page with the same class should fill with the same value).

How do we add a custom class to a form field input?

Found it… the “ID” assigned to an input field is not the ID of the input field… Bricks correctly updates this randomly on page load when a form is used repeatedly (as in my case of using a form as a template) and likely always. However, Bricks does keep “name” the “ID” in the UI.

I do suggest Bricks doesn’t call the input an ID when it is NOT an ID… why is this being done?

Anyway, to solve it: document.querySelector(‘input[name=“form-field-jkedmw”]’).value